I used the following method in my Character Pawn blueprint to set a gravity direction and strength. It worked for a pawn with Floating Movement Component. It stopped working when I created a duplicate of the pawn blueprint and converted the movement to Character Movement.
Are there known issues with Add Input Vector and the Character Movement Class or am I tripping up on the basics?
Thank you so much for your reply. I really appreciate it. I tried Launch, and Add Force with no luck. I must have set something else up in a faulty manner - or checked the wrong box somewhere.
Physics is enabled at the Capsule Component level.
Manually entering force Z=20,000 in Add Force results in no movement.
Controller input works. Input Axis with either Add Torque or Set Physics Linear Velocity is fine.
Thank you very much! With your last post I WAS able to get my method for gravity working. All of your advice has been right on the money. I have not been able to get both my Gravity and Physics thrusters to work simultaneously, so still broken unfortunately.
“But dude, why are you setting your spaceship up this way, and why simulate gravity this way?!”
I simulate gravity this way because the location of the World Origin (gravity) actually changes as the ship jumps from asteroid to asteroid. I cross a collision volume, which updates the World Origin and changes the direction of gravity to the “Current” asteroid.
I also enable physics to the Capsule Component because i like the flying feel I get with linear dampening and angular dampening settings, which is not 1:1 available in the Character Movement Component.
I was only able to get Gravity to work as you suggested if I disable physics on the Capsule Component, and when I do that all of my Physics Thrusters are non-op (creates errors in the logs as well), so i cannot control the ship. Example of a Physics Thruster input control:
I thought I might get around the enabled physics on capsule component bugging out the Gravity method by adding the Physics Thrusters to the Mesh like so, and enabling physics on the mesh instead of the capsule:
…but that did not resolve the issue. Right now I can only get gravity to work OR Physics Thrusters to work, but not both.
I’m starting to think I may need to rethink the way I control the “spaceship” to be more in-line with what these built in components are expecting to avoid strange behavior. Logically, your gravity suggestion should work in conjunction with capsule physics enabled , but it doesn’t.
To put a bow on this thread, two issues remained after implementing this, it seems characters and physics don’t play nice, and characters gimbal lock. I changed my controls to not use physics thrusters, and used a more typical character motion solution. I haven’t solved gimbal lock, but that’s another topic.
I know this post is a little stale, but for posterity and future viewers, I’m also working on a zero-g implementation and was having issues with Add Force vs. Movement Input.
Add Force worked on the Character in all planes
Movement Input did not, and was locked because in the CMC there are toggles for what your default movement modes are: “Walking” will lock you to the XY plane on Input Movement. Changed that to Flying and now I could use both methods, which is helpful since I want to use Add Force in space but Input Movement when on a platform that can be moving in any direction and speed.
Thank you and welcome! I ended up using SixDOF Movement (Unreal Marketplace) and it does what I need. I do not have your requirement of platforms. Welcome to the community!