Sticking parent to moving object (not Moving Platform)

hakul0

New member
Hi,

How can I make character to stick to some scene object, so when the object moves - character moves with it.
I've tried parenting character and setting it's position every frame, but nothing helps. Character either keeps moving independently or bugs in weird ways.

Thanks :)
 
If you set the layer to the Moving Platform layer then the character will move with it. The execution order matters though so depending on when that object is updated the character may not smoothly go along with it for the ride. If the object is animated then you can use the AnimatorUpdater component to update the animator during the correct execution time.
 
If you set the layer to the Moving Platform layer then the character will move with it. The execution order matters though so depending on when that object is updated the character may not smoothly go along with it for the ride. If the object is animated then you can use the AnimatorUpdater component to update the animator during the correct execution time.
Yeah, I've tried that too, but still no go.

What I've tried to do, is I created a Static Movement Type, where no input is passed to the character, except the mouse. It doesn't work event if I set the object base to MovingPlatform.
I've also tried creating an Ability, to stick to a game object, but it caused bugs or I did something wrong.
 
Last edited:
As a quick test I created a new scene and assigned a cube to the Moving Platform layer and then had the character spawn on top of that cube. When I moved the cube in the editor the character moved with it.

For more precise movements you'll want to create an ability that moves with the object that you are standing on. You can use the ride ability as an example.
 
As a quick test I created a new scene and assigned a cube to the Moving Platform layer and then had the character spawn on top of that cube. When I moved the cube in the editor the character moved with it.

For more precise movements you'll want to create an ability that moves with the object that you are standing on. You can use the ride ability as an example.
I've tried the same, but for some reason my character does not collide with the moving platform layer. I've checked the global physics collisions and character's collision settings, but everything seemed to be in order.
 
Try to create a new project and see if that works. If you are working with existing layers and change the order of the layers around you'll need to make sure all of those layers are also updated with the layer managers. If you start fresh it should give you some indication of the cause.
 
Try to create a new project and see if that works. If you are working with existing layers and change the order of the layers around you'll need to make sure all of those layers are also updated with the layer managers. If you start fresh it should give you some indication of the cause.
Okay, so apparently it didn't work because platform's parent has rigidbody component. Is there any way to make this setup work?
 
Top