I’ve looked at a lot of threads asking this question and have even asked Chat-GPT. Most people offer the same solutions and ask the same questions, so I’m asking the question and hopefully providing all the answers to those questions in advance. Why question of why my character isn’t moving forward.
The character is just the skeletal mesh of a spaceship with no animations. The ship can rotate. I’ve launched the game printing outputs to ensure my events are firing, and they are.
I’ve a GameMode called Flying. It has a player controller and a default pawn class which is a character actor called Spaceship.
The collision component’s transform’s mobility member is flagged as Movable.
The player holds down W to increase velocity.
Event ticks rotate the actor model and (should) move the actor the direction its facing. However it does not.
I’ve copied the blueprints from the 3rd person example in this project and that didn’t work either, so I’m convinced there’s a setting somewhere that’s stopping the actor from moving.
I changed the model in the 3rd person example and that worked, but for the purpose of learning I’d like to figure out what I’m doing wrong.
I’d start by not using a character class for this. You will not be crouching, jumping or flailing arms, surely. Perhaps a Pawn is enough + a floating movement component:
I’ve also tried multiplying world direction by velocity, and setting scale value on Add Movement Input to 1.0, in case it only accepts values between 0 and 1, but that doesn’t work.
Regarding this not moving a character. Mildly baffling, indeed. Could we have a glimpse of your world? What are we moving on? Is there gravity? Character movement component can be needy when it comes to surfaces.
Also that rotation would not work well, you’re rotating the actor itself but then sample control rotation which is a property of the player controller a pawn may or may not inherit.
Just this one time ;p Do not use a Character class for this. You’ll shoot a blaster in your own foot if you attempt to do this with a character. I’ll have you know you will not be able to control collision without going into C++. You’re stuck with that capsule.
Use a Pawn:
There will be no walking where this is heading.
Now that we have a fuller picture, there can be a myriad issue with movement in zeroG. Characters really are not meant for this kind of flying and you’d need to write a lot of stuff to make it behave like a spaceship. And you’d still never utilise 95% of the class features because it would be useless.