Hello, I’ve created a pawn class which contains Boat (Static Mesh) , camera, buoyancy and floating movement component. All works fine except moving it with manual inputs.
I manage to move it forward and backwards and even rotate it. But when I rotate and move forward, the movement doesn’t follow along from that rotation. It remains the same since the start, like as it respect a straight line.
I want the movement to be similar from the character third person example. ex: When move to left it rotates smoothly and the movement direction goes along with it.
I searched everywhere and couldn’t find nothing related. Can someone provide me with an example of good practices?
Probably a problem with your movement Blueprint. Compare it’s component properties to the Third Person Example character, and if that doesn’t help, post a screenshot of it here.
Try getting the forward vector of component you’re rotating then multiply it by the movement. e.g multiply the forward vector by a float, then plug that into the movement node. Here is a picture from my game. FYI for me the forward vector is my right vector and I am rotating the body.
So I manage to do this which moves it fine, what is not doing is smoothy rotation mesh itself when going right+forward for example. I leave a print of the blueprint
For rotation you should use AddActorWorldRotation. Also both the movement and rotation will be bound by frames so you would need to get delta seconds and divide it by the speed, you will probably need to fix the speed if you have a boost(Instead of higher numbers use lower so that it’s less to divide) and multiply the result by a number to get your speed back to normal.