- Home /
how to make my character doesn't pass through a platform in vertical motion ?
Hi everyone, I have a character walking on a platform, everything is ok but when I put the platform in motion, my character goes through.
can someone help me please ?
thank you
Answer by runevision · May 12, 2010 at 12:44 PM
This has been asked and answered before:
CharacterController falls through or slips off moving platforms
thank you for this link ! I found what I needed in response Codayus.
Answer by Geoff 1 · May 12, 2010 at 11:47 AM
The best way to do this would probably make a script that makes the player a child of the platform when its inside a trigger which is placed just above the platform. Heres my example of it:
var parentToPlatform : Transform; var parentToPlayer : Transform; var characterTransform : Transform; function Update () { } function OnTriggerEnter (other : Collider) { characterTransform.transform.parent = parentToPlatform;
} function OnTriggerExit (other : Collider) { characterTransform.transform.parent = parentToPlayer; }
just set the variables up and there you go
thank you! works! the link that gave me Skovbo Rune Johansen, also has a more radical solution that works and requires no attachment.
Your answer
Follow this Question
Related Questions
Root Motion Controller speed 0 Answers
Character Controller Not Moving Locally 2 Answers
Rotate a calculated motion 1 Answer
CharacterController - hard code X-axis movement to limit movement? 2 Answers
Stopping the Character Controller 0 Answers