I’m trying to make an on rails shooter type game. I have it so that objects spawn in where the mouse is. What I’m having trouble with is have the gun point to where the mouse is located. If someone knows how to do it please let me know.
Essentially the same way you spawned the actor under the mouse, using the get mouse cursor on channel function, use that return vector combined with the actors location and plug those into “get look at rotation” and use that to set the actors rotation on tick
If you don’t mind can make a quick example of what you mean?
for my game, I am making a top down rpg so i have no need for the x and y values, depending on your game you may want to include those pin connections
I got it to kinda work. It rotates to the left and right but not up and down and I have to move around a bit before it gets aligned with my mouse.
Do you have the x and y values plugged in? Like I noted my game is top down so I don’t use them, depending on your game you may need them. Screens of your BP and what’s happening in game would help to understand what exactly your trying to make happen, also make sure any objects, terrain, actors ect … That’s need to be aimed at, have the visibility (or whatever channel your using for the mouse hit) set to block and have collision setup properly
Ok so for yours you probably need to plug in all x, y and z axes, you dont necessarily need to break the pins in your casd
Ya that’s what I figured. I think it’s going to be a lot of trial and error. Thank you for the jump start!