I have got my twin stick controls up and running only problems are:
The rotation control is upside down, for example when I push up on the right analog stick it points the player down rather than up.
When I return the controller to the starting position, it puts the player back to facing the way they started the level. So if the start facing the left wall they can move around but once they let go of the right stick it goes back to facing left, rather than just staying at its last position.
Here is the blueprint (only the part that controls the rotation)
Any help appreciated! (screens of blueprints preferred)
You simply need to reverse the axis values. Multiply by -1 then connect that.
Try adding relative rotation instead of set rotation.
Edit: actually there is no relative rotation function for this, use get control rotation, add the gamepad axis vector then use that to set control rotation.
Unfortunately neither of those have worked. The Multiply is just sending the Pawn crazy and making it twitch back and forth, and the get control rotation needs a target, I got an instance of the controller but it made no noticeable difference
Well, one way that strikes me would be to take your X and Y stick data and generate a vector. Then use a Find Look At Rotation node with your character’s location as the start, and your character location + your stick vector as the destination. Then toss out everything but yaw and slap it on the character.
Will give that a try when I get home later. who knew making a character rotate would be such a pain, got most other things setup with minimal resistance!
Anyone have any idea of how to make this in a similar way but by using the mouse to aim and rotate the character in topdown view instead of the gamepad? Similar to say Alien Swarm as an example
Yeah I have tried that but it doesn’t really use the mouse to aim/shoot, instead you click to move the character with the mouse, I have problems identifying where this is done in that example
ok bumping this thread - turns out the rotation is causing issues - I’ve found through directly possessing the pawn that when the rotation goes through a certain 90 degrees (depicted below in red) the pawn view is actually rotating 90 degrees making the game world appear as if you were lying on the floor
essentially the X & Y of the right analog stick is creating a vector which then gets turned into a ‘rotation based on axes’ then sent to the controlled actor
any ideas what in the world could be causing that?
The problem might be on the ‘Make Rotation From Axes’ node - currently you are supplying (0,0,0) for Right and Up, but the node expects unit vectors for each input. Maybe try first using a Normalize node on the result of your MakeVector (to ensure its length is 1) and then use the ‘Rotation From X Vector’ node. You might also only want to change rotation if the input is non-zero. This is a rough sketch, have not actually tried it!
Oh my god they actually work! Amazing! Colours seem brighter now!!
Can’t thank you guys enough - And James, a twin stick example would be so beneficial, simply because it seems setting rotation like that is so much more complex than other methods
Hello my player seems to be off. When I push the right_stick in the up direction my player turns to the right and not straight up like I thought he would. I wonder do I have to offset this by 90 or something. Okay have a good day!!
im using set actor rotation method as described and everything works well apart from one glitch. when the right stick is released the actor resets to facing +X instead of remaining the the direction it was facing. Any Ideas?