how can i tell the player to accelerate into mouselook direction, when i’m in standard walk movement mode in zero gravity?
I think I have a solution. First off I want to note that this solution was partially inspired by this [post]. The steps I took to make this behavior possible are listed below.
Set the Movement Mode of you CharacterMovement component to “Flying”. There are two ways to do this. You can set the Default Land Movement Mode to “Flying” under the General Settings category in the properties panel of your CharacterMovement component as seen below.
Or you can set the Movement Mode at any time using the Set Movement Mode node as seen below.
You will need to setup input mappings to use your fly forward behavior. I created a Axis mapping and used “Left Shift” to fly forward and “Left Control” to fly backwards as seen in the picture below.
You will now want to use your new input mapping to tell the player where to go. I found two really good ways to do this. You can use the “Add Movement Input” node as seen in the picture below.
Or you can use the “Add Impulse” node on the CharacterMovement component as seen below. As a side note, I am pretty sure you can use the “Add Force” node in a similar manner, I just used the “Add Impulse” node because I found it easier to work with.
Important Note: You must use the forward vector of the camera to make this work. If you use the forward vector of the actor, then the character won’t always move to where you are looking.
I hope this answer helps,
wow perfect, i’ll try to implement this and let you know, if i was successful!
thank you a thousand times!
it works perfectly! thank you very much! although if usign “add movement input” and not the “impulse”, i believe you also need some kind of multiplier since the force seems to be very low. i’ll stick with the impulse version.