0
Answered

Player Stay with a Moving Platform

Shane Peterson 1 week ago in Game Creator updated 1 week ago 2

Hello,

I have a trigger that toggles a moving platform's position. When the player is standing on the platform and it's triggered, the player doesn't move with the platform. The platform slides out from under the player and the player falls. Is there a way I can make the play stay on the platform, but also be able to move around?

Unlike the hoverbike tutorial video I'd like to still allow the player to walk around on the platform while it's in motion.

Thanks!

Unity version:
2019.2.13f1
Game Creator version:
1.0.7
GOOD, I'M SATISFIED
Satisfaction mark by Shane Peterson 1 week ago
Answered

Hi Shane;

Unfortunately, we use Unity's default Character Controller, which doesn't inherit the velocity of whatever is the character standing on. There's a way to solve this though, but it's a bit cumbersome.

On the moving platform, add two Triggers and set them as "On Player Collide Enter" and "On Player Collide Exit". The "On Player Collide Enter" will be called each time the player touches the platform. 


You need to use the Action called "Transform" and set the platform as the parent of the Player (set the target as Player and select Parent -> Platform).

For the "On Player Collide Exit" you must do the same, but clearing the parent of the Player.

Hope this helps! We're actively looking for a solution to this problem that works out of the box. For the next Game Creator major iteration we might switch to a Rigidbody based character controller, which solves this problem without further set up.

+1

That worked great!

It's unfortunate that the velocity isn't maintained as my player exits the trigger, but for the use case I'm working on (riding a hot air balloon and simple elevators) it's fine.

Thank you.