How to get projectiles to shoot in the direction of and continue going without going in to the negative-Z direction (Top-Down shooter)

Hello,

I am working on a Top-Down shooter, and I’ve recently just figured out the way to shoot in the direction the cursor is. See images below:


So, the projectile goes in the direction of the cursor, but my problem is that since the camera is at this angle, the “target” of the Find Look at Rotation sends the projectiles in the negative-Z and it goes below the screen.

I have found that sending all three X,Y,Z value from Find Look at Rotation to Make Transform is needed to accurately send the projectile in the direction of the cursor, but in doing so, my current problem is arising.

So my main focus is twofold:

  1. Have accuracy with my projectiles, so it shoots exactly where the cursor is.
  2. Make the projectile continue somehow so it shoots the same length (regardless of how short my cursor may be from my character)

If anyone can help guide me in the right direction, that will be very helpful.

Thank you so much!

1 Like
  • for the projectile with no gravity:

  • player aiming and shooting:

The above does not require you to have a surface to trace against. So it’s always horizontal, if you do require elevation (to hit the bad guys upstairs), do tell - tracing can be incorporated into this.


Make the projectile continue somehow so it shoots the same length (regardless of how short my cursor may be from my character)

You may need to elaborate on this one, not sure how to interpret this.

edit: I think you meant that if the cursor is close to the character, you hit the ground early on - that’s because you trace against the ground. Try the above method.

1 Like

Thanks a lot @Everynone! I’ll give this a try and update you soon!

Thanks man I had been stuck trying to do this for atleast 5 hours until i came across your post

1 Like