I’m new to UE4 and I find myself struggling to implement a Megaman X style movement for my character. That movement consists on:
- character can walk in 2d
- can control the height of the jump (the longer the button press, the higher the jump)
- can dash sideways (grounded or in air)
- can wall jump
I can see several ways to achieving this:
1- Start from side scroller template and add code on top of the template character
2- Override CharacterMovementComponent and change its behaviour
3- Start from an empty pawn the do all the movement from scratch
4- Start from an empty pawn with physics and apply forces
In my past experience developing games, I would do number 4 and create all the movement on a physical object, but in ue4 this does not seen to be the best aproach.
For ue4 I think number 1 or 2 to be the best options, but 1 is everything premade, so to implement jump height control I found myself getting into number 2.
To change CharacterMovementComponent behaviour need some quite good undertanding on how it works by reading the source code. So I’ve tried number3.
In 3, if I added charactermovement I would go back to 2. So how can I move it with collision detection?
I found AddActorLocalOffset , it do almost right, but it stops completely on collision, so the character can’t move on slopes.
In 4 I would have full control of movements with collision. But I found that I can’t disable friction nor change my mass to the value I want (without geting changed by the volume). I think I can lock rotations on X and Y axes on code, but I don’t know if there is a right way to do it. I got the feeling that physics in ue4 are intended to be used on props and obstacles, not for gameplay implementation.
Well that is my initial thoughts. Have I missed something?
I have no problem with c++ or blueprints. I just would like some orientation on the best way to do things in ue4. How would be your aproach?