"Docking" objects

Okay, I’ve got a conundrum.

I have a docking object, and I’m trying to dock a ship with it. My goal is to have the ship, upon touching the docking object, completely stop and reset its position to the initial position at the start of the game (the ship starts at the dock).


Hi, which part gives you problems? Do you have any events? I am asking because how you describe it, it sounds like you could just implement that.

Sorry it took me so long to get back (that pesky work thing).

When I have the ship collide with the dock, I tried to set it up to 1.) stop the ship, and 2.) turn the ship back to its angle of departure. Problem is, the ship doesn’t want to leave the doc, even if I use “Trigger once”

I’m monkeying around with some other options at the moment.

EDIT: Basically what I have now is that I delete the original ship and create a new ship at the position, ready to launch. It does the job, but it looks a bit stilted to see the ship suddenly turn around on the docking platform.

Consider using finite states for your ship; say something like Sailing, Positioning and Docked.

When the check is made to collision between ship and dock, add a condition that checks the state is Sailing, and only then allow the ship to stop and set state to Positioning.

In the Positioning state, move the ship so it gets reset. and set the state to Docked.

In Docked stated, it can move away from the dock at which point you’d also set it’s state to Sailing.

You may need to break it down further as you see fit.

1 Like

Thank you. I’ll try that as well.

What I have works for pragmatic reasons, but it doesn’t look good. If nothing else, I can fall on that as needed, but I’m hoping to make it look better.