Hi guys
I am creating a prototype game that features ships (think the Mayflower). I am having a lot of trouble working out how to
implement the basic movement for the ships.
I am targeting Mobile platform and therefore I am looking for a performant solution. I want each ship to “handle” differently based on have certain qualities. I want to be able to tune Acceleration, Top Speed, Turning Angle / Rotation for each ship.
The player will control where the ship moves by tapping on the screen. However, this is where I come unstuck. I can’t seem to find a good
solution that adequately meets my needs.
Desired Navigation Behavior
- Accept target destination location Calculate the navigation path, taking obstacles (e.g. islands) into account and navigating around them
- Orient towards the nav path with cusmotisable rotation speed for each ship
- Accelerate (customisable property for each ship) to Max Speed
- Decelerate (customisable property for each ship) to rest when reaching the destination.
What I’ve tried with limited success
- Using FloatingMovement Component. I can’t seem to get this to work with acceleration /
deceleration and rotation. In my every attempt it accelerates instantly which
is a deal breaker. - Create custom BP to move the pawn. I tried to replicate FlyingPawn from the default
templates. This worked reasonably well, however, it does not handle obstacle
navigation and pathing. I am at loss how to write custom pathing from scratch.
I could sphere trace forward on tick but the solution needs to be performant on
mobile. I don’t think that would work. At any rate, doing so would tell me if
there is an obstacle ahead of me, but not how to get around it. - I looked into trying to create Characters instead of Pawns, but that doesn’t seem
to work very well. I am not sure what to do with Skeletal Mesh and how to
handle the player capsule. It also feels “wrong” – this should really be a Pawn
and not a Character.
Question: what is the best way to achieve desired behavior for me?
Thanks everyone