Move character forward blueprint

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.

image

The collision component’s transform’s mobility member is flagged as Movable.

image

The player holds down W to increase velocity.

image

Event ticks rotate the actor model and (should) move the actor the direction its facing. However it does not.

Take a look at one of the default characters ( first / third person ). You have to add movement to the character component

Sorry, I thought I shared the screenshot showing I was, but I must have accidentally removed it.

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.

Try printing out the velocity on tick. Is it changing?

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:

The above would move a pawn regardless of anything else. You can still incorporate Control Rotation:

But it’s optional. Depends on what kind of movement you want to work with.

Ye, she’s all there. Changes on event tick and on IA_MoveForward event.

image

Rotation is here below, so we know it’s not returning 0.0 ,0.0 ,0.0

image

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.

1 Like

Sure, it’s just a default empty world. Please do excuse my crude 3D model.

The ship doesn’t use gravity, though its starting Z axis is 600 so it appears to be flying.

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:

image

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.

This could stop movement, for example:

image


The most mundane setup could look like so:

1 Like

Roger that, I created a new pawn BP and copy-pasted over the camera boom, mesh and camera components.

I remembered why I swapped to a character BP. It was because I was able to change its default transform rotation. I’ll edit the model quickly now.

You can do a lot of stuff in the engine these days:

Would have been handy, the number of meshes I had exported facing the wrong way…

1 Like

Awesome, I got it working.

Your suggestion to use a FloatingPawnMovement component worked.

image

Cheers for taking the time. Very excited to move forward with my project now.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.