Hey guys,
It’s the first time that i’m practicing with a playable character on unreal, and i’m a little bit confused.
In fact I recently wanted to start I quick project based on the sidescroller template from Unreal.
My goal is really basic : making my 2d character facing my mouse no matter wich direction he’s going.
Based on the template, the player can only move on the Y axis ( he is always running forward )
My idea is to keep this basic movement ( left or right ), but I’m searching for a way to constrain the movement :
- If I want to move to the right with my mouse to the left, I want the player to walk backward.
- ( let say I keep running to the right, but in this scenario the mouse is to the right ) then the character is running forward
Here is a basic example of the system i’m trying to reach :
As you can see the player is always looking to the mouse( Do not consider the aiming system, i’m just looking for a way to make the body facing the mouse )
First, I started a quick code to tell unreal when I consider my mouse to be in the “left or right” position
I also changed the animBP to allow the character to walk backward if my player speed is negative.
I would say that’s where i’m confused, I have no idea where to start.
I would really appreciate some advice, ideas to help me solving this problem !
Thanks to everyone who takes the time to reply to this
Best regards,