Need help designing a sinking platform that lets objects pass through from underneath
I have very little experience with Unity, but I've experimented with walking around a landscape with a first person character.
What I want to make would look a bit like this:
You'd be able to collide with these objects, so they could block your way, or you could stand on top of them, and if you were to step or jump off of the sinking platform, it would stop sinking. The platform would eventually reach the ground, and stop.
Thanks for any help or advice!
Answer by Shadowplays4K · Jun 12, 2018 at 04:56 PM
you can use a script that checks for the player in a collider the collider will be a second object, then if the player is detected then use the transform ( the example uses c#)
public gameobject platform;
void Update {
platform.transform.Translate(0, -1, 0);
}
basic moving script
then you add a collider to the script using a if statement so it only moves when its detected in the collider
make sure to put the platform object in the script this can help explain more https://www.youtube.com/watch?v=YfIOPWuUjn8
Your answer
Follow this Question
Related Questions
Sphere is not using OnCollisionEnter/OnTriggerEnter/OnCollisionStay/OnTriggerStay functions 0 Answers
In a scene with multiple doors if one is opened lock all of others? 1 Answer
Collision Detection between two different Prefabs doesnt work 1 Answer
Issues using two scripts. 1 Answer
Box Collider Briefly Clipping Through Ground After Fall 0 Answers