I just want a projectile to fire into a random direction with a random speed when it is spawned.
This seemed to be a very simple task, until I tried to actually make it. The projectile, no matter how much velocity, speed or rotation I give it, will never shoot into any direction except 0 or just fall to the ground.
When I set the initial speed via Blueprint, it just doesn’t fly at all and just falls to the ground.
When I set the velocity from X,Y and Z into random floats, it just fires into one direction.
I have no physics or anything, just a projectile movement with a bounce.
What components do you have in BP? You cannot have scene or anything like that as root component if you are using projectile movement. Only moveable components
The way I would do this would be with 2 blueprints, 1 for the turret model/position where I would define a socket, the other being the projectile.
On event begin play I would spawn Actor by class, find the class, create a ‘make transform’ node I would get the transform of self and then break the rotation, in rotation I would do random float in range and do it from 0-360 then rig that all up to the make transform node.
That should work? I wouldn’t touch the projectile until I had the behaviour I wanted from the turret.
I think setting the rotation of a projectile would just rotate the project. not change what direction it fires in.
Doing it my method would get you the results you wanted. (Setting the spawn transform).