Projectiles don't go the right ways

I am trying to make an automatic shooter which changes depending on the direction you move in for a topdown shooter. However the projectile does not what i would expect it to do. So i made a dummy to test the code and on the bright side it did the same thing, on the downside it wasnt what it was suposed to do.

I got a vector which should determine where i am shooting at but it doesnt seem to work.

i get the following results with the following vectors:
(0,1,0) expected direction up, result shooting down
(0,-1,0) expected direction down, result shooting down
(-1,0,0) expected direction left, result shooting up
(1,0,0) expected direction right, result shooting up
(-1,1,0) expected direction up left, result shooting left
(1,1,0) expected direction up right, result shooting right
(1,-1,0) expected direction down right, result shooting left
(-1,-1,0) expected direction down left, result shooting right

I am at a loss as it makes no sense to me, I hope someone else encountered this before and knows how to solve it.

Hello,

I’m working on a top down game as well and I have a similar set of nodes as your screenshot. So I compared both and noticed I have a fixed 1,0,0 vector multiplied by the variable projectile velocity for the “Set velocity in local space”.

Worth trying I guess

1 Like

The most minimalistic method:

Deriving direction from character velocity, you may have another method - make sure the direction is orientated correctly before you ask projectiles to follow.

1 Like

It is in Local Space, which means relative to the projectile’s rotation. The projectile is already rotated towards the desired direction, so in local space the Velocity you want to advance in that direction (forward) should be a simple forward vector (x=1500,y=0,z=0)

2 Likes

For my top down I use get hit result under cursor by channel (the mouse location) and get character location, plug those into “find look at rotation” and plug that into the spawn rotation for the projectile

1 Like

Well technically this is how I control my characters rotation, alternatively you could just plug in characters rotation to projectile spawn rotation too

I must admit i felt slightly sad that this works, considering the huge blueprint it came from.

thank you so much this solved it.

The projectile movement comp has 2 modes, so to speak:

image

You either use Initial Speed and Rotate. Or use velocity.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.