How to set an arrow trajectory
LordTarantor
Member, PRO Posts: 890
Let say that my archer shoots an arrow and I would like the arrow to always point to the direction it is traveling to. How can I do this?
Comments
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )
When it is spawned by the Bow actor
it has an Accelerate: Direction=270, Acceleration= 600, relative to scene
Then it has a Change Velocity: Direction=0 Speed= game.Power +game.BasePower
Relative to actor
It goes where it is supposed to go but it doesn't rotate so sometimes the arrow hits the enemy sideways.
@3itg: where should I add the vector to angle rule?
Accelerate the arrow at 0 as well... 270 sounds more like the direction you want to fire in.
Edit: I made an example of what I think you want, plus a little more.
The gravity is set pretty high in the scene, as well as arrows physics should be paid attention to. I exaggerated everything in the example.
https://dl.dropboxusercontent.com/u/93591418/Archer Example.zip
I made a rule to allow make the "Force" apply for .3 seconds, to get that "Arrow" feel, you cant keep pushing the arrow after its been fired. After that I just let the physics settings take over.
I'll get right to it!