Character movement

Hello, I’m new to unreal engine 5 and coding in general and I’ve been fallowing this tutorial:
UE4 Flying Jet Movement 4.25 - YouTube I’m stuck at 12:05 where he says we should be able to see the flying pawn moving.

This is my current setup:


First I got an error saying this: unreal engine 5 Invalid Simulate Options: is set to simulate physics but Collision Enabled is incompatible

So I looked online and read that I need to set the collision first



I don’t know which one I should be picking from the drop down menu, but when I tried first my camera was behind my character just not moving at all then I set a couple of those collisions and my camera wasn’t behind the character anymore.

Without the Collision part:


After setting the collision to “pawn”:

I just want to make star fox like movements. Help please!

Hey there @Hakushi! Generally I avoid using physics for systems where you’re going to want full control ie starfox style movement. That said I’m here to help, not force you to refactor everything you’ve done! To keep with your tutorial, you’re going to want to set it to Custom and go down the list of what should and shouldn’t collide with it. Set the camera collision in that to ignore, and the object type to pawn, and you shouldn’t have any issues out of the box and can continue your tutorial. Let me know if this helped or if you have any questions!

Bonus tip: In your hierarchy, if you have an object set to simulate physics, it’s usually best to make it your root (by dragging it above the root object) as when it starts simulating physics it will in fact separate from the root anyway. (unless it is the root that is).

1 Like

Hello, thank you for answering, do you have a tutorial I could fallow that does it the way you would? That said I’ll try your solution and let you know how it went.

Another question, when you talk about the hierarchy you are talking about this right?

image
So I should move the coreling above all?

Ok so I think I tried your solution but it didn’t work, I’m not sure if I did something wrong:

My hierarchy
image

My collisions


image
image

Thanks again!

I took a look around and was unable to find a direct tutorial on specifically star fox style movement in the way I’d do it.

It’s generally doing the exact same thing as you are now, but with the floating movement component and utilizing some of it’s natural features. It lacks (faked) gravity on it’s own though so if you wanted that then it’s either physics sim or another type of movement component.

Another method is using a spline (as most of the starfox titles are on rails), and only adjusting the local location of the ship on said spline. If you were looking to do spline based movement I have a tutorial that shows you how to get the spline movement rolling if you wanted to try that out in the future.


Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.


Spline movement:

But what did I do wrong then? Why isn’t the tutorial I am fallowing working? Did I set the collisions wrong?

Also I took a look at this spline tutorial It doesn’t seem like you have full control of the character using this, I want movements like… Maybe f zero X but in the air if that makes sense?

It might be related to the mesh itself needing to be the root, he glazed over it in the beginning of the tutorial but it is immensely imperative. You had it right, just dragging it over the root and dropping it.

Now we can get into some debugging! So first things first, is the pawn set to auto possess when you start the game or do you have it set as your default pawn in your gamemode so you automatically spawn as it? Otherwise you spawn as a totally different placeholder pawn.

If you put some prints on your character’s inputs just to verify it’s receiving them, it might clarify some of the issues!

Also, for the spline bit, it’s more relevant if you were doing older starfox titles where you were on rails and only moved around in the screen space. That tutorial just gets you the spline movement, after that you’d still have to add local offsets to the ship to move around the screen, and even more work to aim things etc. It’s just the first piece to that puzzle. F Zero X was kind of the same way. Constrained to the track without full 3D control. Many things we do tend to start as one thing and add different bits of knowledge (and usually kitbashing tutorials together in the early days) to get a different outcome.

1 Like

I didn’t know those games were made using rails! I always thought it was free movement since you can get out of the road in F zero X! The more you know :smiley:

I think it’s set to the one I’m making? Not sure if this is the correct option.

The racing games not quite as much. It’s more of defined track system where they were pushing the limits of early 3D but it’s decently constrained. I was remembering one of the early F zero games where it was solid track.

Alright so your default pawn is called flying movement so that’s good. So when you start your game you should spawn at a playerstart as that pawn and possess it, so the camera is attached and you should be routed to the correct one.

Now, in your blueprint, right after your input fires, add a print string for one of them just saying the value of that axis. This will let us know if your pawn is receiving the inputs. Afterwards we’ll know if you’re just having a camera issue, a logic issue, or a map issue (or combination).


Here are the new nodes in case I did something wrong.

So I press left shift inside the play testing which is my thrust input and nothing seems to happen.

I looked for an explanation of the string node and it says I should be seeing a blue test pop on the top left corner of the screen. (Taking notes)

This doesn’t happen in my scene.

Alright, so it seems your inputs aren’t making it into your pawn even if the pawn is being spawned. So we’re gonna do a quick checklist to verify. When you play your scene, hit Shift + F1 to release your mouse from mouse lock, then click the pause icon, then the Eject icon. This will let you see the scene that’s currently playing from the editor directly. You can then see if your pawn is the one you’re attached to.

image

You should see your pawn, and can move the camera around now. Just pull back and take a look at your pawn, make sure there’s only one, verify that it’s there in the outliner. It’s reference in the outliner will be yellow. If you click your ship it will also highlight itself in the outliner as well.

Since your print didn’t work at all, your inputs aren’t being received. In your player start actor in your scene, make sure it is set to always try to spawn.

This is just a failsafe to make sure to spawn the pawn if it didn’t end up spawning.

Check all that and let’s verify your pawn exists.
(you could also put a print on begin play but I want to make sure you know all this for the future)

1 Like

Thanks for taking your time for showing me all this!

This is how the scene looks, the pawn is not yellow in the outliner.

And in the details tab I can’t find the PlayerStart (Instance) Is it the FlyingMovement I created?

Ok so i managed to make it move I think! I set the collision to overlap
like so

But for some reason I think the skeleton is all over place, it’s moving weirdly even though I haven’t set the animations anywhere.

Also I can see the blue test now!

This is how it looks

It is progress though :smiley:

No worries! I was off work since yesterday, so apologies on the late response! So when you have a physically simulated SKM, it basically ragdolls initially. Physically simulating an SKM intentionally makes it a ragdoll, so it’s very easy to make ragdoll physics off the bat. In your case it’s not what you want. I believe you can change the physical asset itself and make it rigid, but the downside here is that because your flying system is physical, your animations would prefer to be as well. Not too bad for an experience dev, but you may face a bit of a challenge there.

So on to making those bones less floppy.

So there’s a ton going on in this image, so I’ll explain where I’m at. I’m in the Physical Asset of the Skeletal Mesh. You may or may not have one already for your mesh. I’ll include a tutorial for making one at the bottom of this if you haven’t. This takes over when you simulate physics on an SKM. This way you can control how the limbs bend and move. This helps not get super whacky distorted ragdolls. However in your case you’re going to go in and select the limbs, then their constraint (in the left) and set the constraint to either limited or locked. This will allow you to have those bones completely rigid by setting those values to 0, or locked.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

Tutorials on physical assets:

Documentation on physical assets:

Hello! Thanks alot for the reply, really, thanks to you I seem to have solved the armature issue but…

This happens now… And I can only laugh… haha any idea why this happens?

So I was rewatching the tutorial and the mistake seems to be around here:


Not really sure though, I deleted the rest of the nodes.

I think the first thing to do would be to verify if it’s physics being weird or if it’s a logic issue. SKMs can have odd effects when simulated, if you’ve ever seen a ragdoll in a game get it’s arm stuck in it’s hips, it starts doing somersaults infinitely because there’s no reduction in the force that’s pushing it. Your SKM’s arms might be causing this. Strapping this code onto a static mesh it should run fine. Only forward with what you have right now (unless the UpVel is already declared).

Are you generating your Up Velocity variable anywhere or any torque?

yes, here

And also, If I use a static mesh instead of the skeletal mesh can I use my animations still?

And it seems that the thrust value in the video was too high for my drone for some reason I lowered it and it worked better, It still behaves a bit unstable though.

Also for some reason there is a copy of my actor that falls off. Anyway, you have helped me alot! thank you very much.

The static mesh test was to verify if your SKMs “arms” there were contributing to the physics flipping out even though you locked them, not as a solution. I doubt they are contributing. The camera having some lag behind the movement is pretty disorienting. Are the movements just incredibly exaggerated? Your rotations, while decently high values, should be fine. Can the ship just go forward, or does it start shifting immediately?

No the camera lag is not intended either. I’ll show you the settings here.

and the ship goes forward without input for somereason although I think the person who created the tutorial made it that way (I don’t want it that way) and the ship starts spinning uncontrollably and is hard to maneuver (turn and roll inputs are working) and the reason I set the rotations that high is because of this because it helped me control it a bit better.

Spring arm settings—>


I also forgot to mention the variable’s values just in case



The tutorial actually used 5000 on the max thrust but it was spinning way worse.

So first thing you can disable the camera lag by unchecking these two on your spring arm
image

You can enable them again later should you want to once we get a good idea of why your movement is spinning out. This is part of the “fun” with physics based movement. It looks like you locked the arms themselves fine.

Yes the tutorial is made so you go forward unaffected by gravity unless you go too slowly.

If you’d prefer I could show you a better way to do this without physics. Are you trying for like plane never stop moving movement or like floating drone full control?

the second one, I actually remembered which game inspired me in the first place.

Forsaken 64 any% speedrun (37:16) - YouTube<—something similar to this?

They seem to have full control over their movement (except for when they stop going forward they don’t fall and i’d like them to fall if you are not trying to move forward or maybe a way to make them fall).

Also yes, for your I’d like a way without physics. But I still wonder why physics based movement isn’t good for skeletal meshes.