He guys i’m making a puzzle platformer and i want to shoot projectiles towards the current mouse position, I Have got projectiles shooting from a standard point on my player character and moving off in a forwards direction, But i really nee the projectiles to be able to be fired towards the mouse position. Any help would be appreciated as i seem to set them fire in every direction except across
You can use the node,
“Get Hit Result under Cursor By Channel”
This will give you where in the world your mouse is hovering over. From there you can derive the direction for your projectile.
Hope that Helps =)
Hey there, I tried that that just seems to make the projectile come at the player out of the screen rather than out of the player and along the Y axis
Make sure that you still launch the projectile from the player via a Socket Location.
For the direction, ImpactPoint(from trace) minus SocketLocation.
Multiply the direction by a float magnitude and thats the velocity.
With that data and to recap, Spawn the Projectile from the SocketLocation and apply the calculated velocity.
Hopefully that helps =)