I want a unit attached to another unit. Actually its a soccer kind of thing. I want one unit (the ball) to be attached to another unit, like, always in front of it.
The unit might "lose" the ball and another unit might get it.
Right now im doing it with triggers, a trigger running every 0.02 sec or so and setting the ball's position. The problem is, it looks very "choppy" and not smooth at all, i believe its maybe because periodic triggers dont run more often than every 0.05 sec or so ?
I need a solution that attaches the ball to the unit and ideally be able to also rotate it and slightly bounce up and down.
as far as i know missiles get updated twice each frame (32x a second), but updating the position every 0.0625 should be fine, you just have to finetune your trigger. bouncing is pretty hard to achieve, my best attempt was launching a ballistic missile that launches another ballistic missile at impact.
This is now possible in 3.0 with the new kinetics data type.
To do this, you'll need a to create a Follow Kinetic (leave the data settings to default), as well as an Apply Kinetic and Remove Kinetic (which are new Effect types).
I recommend using a behavior to control the Follow Kinetic so that the ball is attached to whichever unit last applied the behavior to it. So the Behavior's initial effect would apply the kinetic, the final effect would remove it, and the refresh effect would be a Set Effect that removes and then applies the kinetic.
You could use a Kinetic Set of Follow + Translate to have the ball always be in front of the unit (although you may have to use the trigger action UnitMoveInstantly to position the ball correctly whenever the carrier changes).
As for rolling and bouncing, those are best achieved by adding site operations to the ball actor. Site (Rocker) can be used to achieve bounce and Site Operation (Rotator) can be used to achieve roll. Each can be applied to the ball actor dynamically with the HostSiteOperationsSet actor message (or the new Add/Remove actor message).
I want a unit attached to another unit. Actually its a soccer kind of thing. I want one unit (the ball) to be attached to another unit, like, always in front of it.
The unit might "lose" the ball and another unit might get it.
Right now im doing it with triggers, a trigger running every 0.02 sec or so and setting the ball's position. The problem is, it looks very "choppy" and not smooth at all, i believe its maybe because periodic triggers dont run more often than every 0.05 sec or so ?
I need a solution that attaches the ball to the unit and ideally be able to also rotate it and slightly bounce up and down.
as far as i know missiles get updated twice each frame (32x a second), but updating the position every 0.0625 should be fine, you just have to finetune your trigger. bouncing is pretty hard to achieve, my best attempt was launching a ballistic missile that launches another ballistic missile at impact.
all info pre 3.0 patch
@JimyStyles: Go
This is now possible in 3.0 with the new kinetics data type.
To do this, you'll need a to create a Follow Kinetic (leave the data settings to default), as well as an Apply Kinetic and Remove Kinetic (which are new Effect types).
I recommend using a behavior to control the Follow Kinetic so that the ball is attached to whichever unit last applied the behavior to it. So the Behavior's initial effect would apply the kinetic, the final effect would remove it, and the refresh effect would be a Set Effect that removes and then applies the kinetic.
You could use a Kinetic Set of Follow + Translate to have the ball always be in front of the unit (although you may have to use the trigger action UnitMoveInstantly to position the ball correctly whenever the carrier changes).
As for rolling and bouncing, those are best achieved by adding site operations to the ball actor. Site (Rocker) can be used to achieve bounce and Site Operation (Rotator) can be used to achieve roll. Each can be applied to the ball actor dynamically with the HostSiteOperationsSet actor message (or the new Add/Remove actor message).
@PirateArcade | I make games | Ask me things on Discord