How can I make a platfrom fall when the character walks/jumps on it?
3 Answers
3Create a platform with a collider and a rigidbody on it, and turn off gravity for the platform. Add an event for OnCollisionEnter() onto the platform. When the player touches and collides with the platform, call rigidbody.useGravity = true; to turn on gravity, thus, making the platform fall down.
Everything that is in bold, you can look up in the Unity Script Reference to learn how to use.
#pragma strict
function OnCollisionEnter(Char){
rigidbody.useGravity = true;
}
I’ve tried dis one ( function OncollisionEnter ( player ) { Rigidbody . Use Gravity = true; } and it works but the problem is that my player barely stay on the platform cuz it falls really fast I tried to active the collision but wen I do that d script doesnt work.
I'm not going to code this for you. If you don't know how to program, learn. Unity is nothing without programming. There are a lot of tutorials out there to help you get started with programming in Unity. Google "Learn Unity Fast" and click the first link for some good tips and tutorials on programming with Unity.
– qJake