Set direction to variable? Bullet Movement

Bullet Movement Set Direction only seems to accept a specific preset angle. Is there a way to set the direction based on coordinates, such as last touch coord?
Thanks!

Hello @Infinitum3D , it is better to use this the “Move Towards” behavior. This Example:

“Move toward” changes direction as the target moves. A bullet shouldn’t be able to do that.

Thanks for the suggestion though.

@Infinitum3D! Explain more specifically what do you need to do? To make it clearer with what task you need to cope. maybe you can use the “Movement” parameter for the bullet and the “Face To object” for the spawner. We just need to understand exactly what you need to do.

Sure.

I spawn an arrow. I can rotate the arrow to face ‘last touch coord’. Then I want to move the arrow in that direction and continue beyond the touch coord.

I’ve tried having the arrow move toward an enemy (a Sprite moving from the right across the screen to the left) but the arrow curves across the screen to match the enemy’s change in position.

1 Like

Hi @Infinitum3D :slightly_smiling_face:, i created for you this project: https://ready.app.link/clReEnwk6O

You can improve this logic for your project, I hope it helped you

ShootLogic

1 Like

This is a very nice demo, @Ready! It helped me understand precisely what ‘forward/backward’ and ‘left/right’ movement means, namely that movement direction is determined by the current rotation of the game object (I presume the same insight can be gained from making the Asteroids tutorial project, but I haven’t gotten to that one yet.)

To help me better understand how it works, in your demo I changed the Shoot Controller to a cone. And to make the bullet follow the current click position (LTP controller) rather than the previous one, I changed the bullet clone event to clone on mouse up rather than mouse down. So on mouse down the Shoot controller rotates to face the LTP, then on mouse up the bullet is cloned and travels in the updated direction.

https://ready.app.link/Di8hFve46O

11%20AM

1 Like

Hello @auntiel ! Thanks!:wink: This is a great solution!:+1:

1 Like