grantPredicted
grantPredicted<
S>(step,character,trait,value):void
Sets character’s predicted trait from the room, adding it where the
character lacks it: a one-off change a rule on the room makes, such as a
pickup that refills its dash’s charges. The player’s page learns of it as
one correction a trip later, and the prediction checks count it as the grant
it is. A lasting effect, such as a slow, belongs in a streamed trait a
predicted system reads on every step instead, which the player’s page
replays. Call it in the system step runs, inside if (step.authoritative)
where the system runs on the player’s page too. A predicted trait any entity
may hold, such as the engine’s cooldowns, is granted the same way on a
character a player controls. As Unreal’s server-side change of a predicted
value, which reaches the owner as a correction.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
S extends Schema |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
step |
AuthoritativeStep |
character |
Entity |
trait |
PredictedTrait<S> | AnyEntityPredictedTrait<Trait<S>> |
value |
TraitValue<S> | ((previous) => TraitValue<S>) |
Returns
Section titled “Returns”void