ProjectileMovement Component: Velocity

Hi!
So I’m trying to make a bow and arrow system where I spawn in an arrow and depending on how long the player holds the left mouse button it changes the velocity of the arrow.

When I tested the arrow I set the z velocity to something like 2000 press play and the arrow flies up in the air. If I rotate the arrow sideways, press play, the arrow flies in the direction it’s pointing, great!
But when I place the arrow into a level with z velocity = 0, increment a float and do a branch to check if it’s at 2000 or not, and if it is I set the z velocity to my new float, the arrow always goes up(along the z axis), it doesn’t follow the direction of my arrow, why is that? :stuck_out_tongue:

Any help would be greatly appreciated!

Imgur
#spaghetticode

Fixed it, changed the “Set Velocity” to “Set Velocity in Local Space” and that worked. I figured it had something to do with the rotation. Am I correct in assuming that when the arrow component has it’s velocity set before I press play, the rotation is “already calculated”?

Anyways, hope this helps if someone else has the same problem :slight_smile:

Imgur

Another solution would be to set the “Initial Speed” of the projectile movement instead of what you did. Set the rotation to the player control rotation and all will be fine. Don’t set directional velocity (x, y and z)

Hope that helps :slight_smile:

That didn’t work for me, but I’m spawning the arrow, holding it still, then releasing it. Does initial speed decrease in time maybe?

I tried replacing “Set Velocity in Local Space” with “Set Initial Speed” and when I released the arrow it just fell down like it didn’t receive any velocity at all :stuck_out_tongue:

Thanks for the tip though, my system is probably set up wrong for it to work x)

Oh.

Set initial velocity has to be set either as the arrow is spawned or before.
Sorry i did not understand exactly what you were trying to do