Add Movement Input for a non-DefaultPawn

Documentation says

Base Pawn classes won’t automatically apply movement, it’s up to the user to do so in a Tick event. Subclasses such as Character and DefaultPawn automatically handle this input and move.

How do you “manually” handle the Input?
I just want to copy the movement of my DefaultPawn by calling Add movement input.

Hey @ironspiderbatman!

The Default Pawn class comes with a movement component, therefore will move when you add movement input without adding anything extra.

To move the base Pawn class using the Add Movement Input node, you need to first add a movement component from the Components window, such as the floating pawn movement component :blush:

Hope this helps!

1 Like

Add movement input is a function on the movement component. Either add a movement component or right your own logic to move the pawn.

Thanks.
I added a movement component to my non-defaultPawn character and called Add Movement Input.
Nothing happened.
Tick was on and I can do other things to the character but Add Movement Input is not working.

Could you share some screenshots of the related parts of your Event Graph?

All you need to do is to have the floating pawn movement component:

And add movement input however you like, for example on every tick like this:

If the pawn isn’t moving, I suspect you either:

  • Don’t add movement input continuously

It’s not like AI Move To where calling the node once initiates movement, it should be called continuously. For example for the duration of a button press, or every tick like in my example above, or with a looping timer, etc.

Or:

  • Didn’t set a world direction

It won’t move if the world direction is left as (0, 0, 0)

Or if the issue isn’t about these:

  • The node isn’t being called

You can check whether a node is being triggered or not by first selecting it and then hitting F9 to toggle a breakpoint. Then when you play your game, it should be paused when that node gets triggered.

So if you still can’t figure it out after making sure of all of these, get back to us with some screenshots showing how you handle the movement!

Hope these help :innocent:

Thank you but my character is not floating.
I want to copy the movement of DefaultPawn including gravity like these cherry clones.

Then I’d recommend using a Character class instead of a Pawn to be able to use the Character Movement Component.

Oh wait now I get what you meant by copying, ok I’ll try it for myself when I’m available.

Thank you again @VisAgilis
Basically if I could do the exact same thing in that mario 3D world then that would be fine.

Hey @ironspiderbatman!

So all you need to have inside your clone character class’ Event Graph is this:

And make sure that the Auto Possess AI property is set to Spawned! To do that, select Self from the Components window on the top left, then while having it selected, navigate to the Details window on the right side, type in “auto possess ai” into the search bar, and select the Spawned option from the dropdown menu next to the property like this:

And here’s the result:


Again, as I mentioned before, you’ll wanna go with a character class for such movement mechanics instead of a pawn class. Not related with your main objective of controlling the clones tho.

Hope this helps! :innocent:

This is what I was looking for! Thank you @VisAgilis! You are super helpful!

1 Like