Disable player movement but allow camera control

Hey,

is it possible to disable the character movement but allow the player to control the camera in Blueprint?
I want to freeze the character in place until the player looks at a certain area, then unfreeze the movement.

Thanks in advance,
Florian

1 Like

You can. Create a boolean variable named ‘Movement Locked’. Set it to true when you want to lock the controls. Within the event handlers for charcter movement (Move forward, Move right…), use a Branch node to test for this boolean variable and apply movement inputs only if it is FALSE.

When you want to let the charcter move, set this variable to False.

1 Like

Thanks, but I am working with a C++ Third person project, so there are no BP Events for movement. Is there a way to do this with Blueprints in my case?

Events for movements = The Axis and Action bindings for your charcter.

Look below and see the answer from @rjvm . That is what I meant.

You should follow that blueprint and it will work.
One thing you might want to change is when you change ‘Can Move’ to TRUE or FALSE. In your case it must be based on charcter rotation

I know what you meant but I don’t have those events implemented already, since my Project is based off of C++ Third Person. My Character Blueprint looks like this:

The events in there are the ones I wrote for my purposes, otherwise it is empty. When I try to implement the method below by adding the axis events, I just can’t move at all. I’m guessing the Blueprint and the C++ code conflict with each other and an error occurs.

Thanks for your efforts, but I’ll solve it using code.

This method definitely works if you’re using the BP template, for anyone else looking for something like this!

Couldn’t you do the same logic in your C++ code?
I mean you already have functions bound to events. Just add this additional logic in there. Its only a single If-else statement.

Yea it’ll be the same logic :slight_smile:

I thought I had answered

You took what mindfane said and gave an example of it, and I appreciate that, but he gave the answer.

Up voting this. Came across the same problem, and the same solution before I stumbled on this thread. This is probably the best way to do it. Tried using Disable Character Movement but it was producing odd results when Character was placed on other moving objects (e.g. platform or a moving ship)

Works as it supposed to. I thought there might be a seperate blueprint function for this already, but a bool is a straigt forward solution. :+1: