Add Input Vector - Character Movement Component Doesn't Work

Hi all,

Thanks in advance for your input.

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?

image

Thanks!

Not issues per se, it’s just the way it works may be counterintiutive. This particular node combination does not like verticality much.

Try Add Force or Launch Character instead:

image

With forces you’d need to up the magnitude. In game Gravity Scale of 1 = 98100, for example.

1 Like

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.

Any other pointers much appreciated.

Not needed. The movement comp takes care of that. But could be fun for some other reasons, for sure.

Manually entering force Z=20,000 in Add Force results in no movement.

Is the gravity set to 0? With gravity set to 1, you’d need 98100+ to move the character up.

Controller input works. Input Axis with either Add Torque or Set Physics Linear Velocity is fine.

Not sure how this is relevant, you’re using tick. Again, this is not technically physics sim, the movement component emulates it, kind of.

No additional steps are really necessary, default 3rd person template:

We have a liftoff, ladies & gentlemen :rocket:

This should work in any direction.

1 Like

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.

image

“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.

image

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:

image

…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.

Char mov and physics do not play well, indeed. The component does its own simulation, and using both can be painful.

For gimbal lock and more nuanced directional gravity that works with characters, do look at the marketplace. There’s a number of good solutions.

1 Like

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.

2 Likes

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!