- Home /
This question was
closed Dec 01, 2014 at 04:17 PM by
SaraCecilia for the following reason:
Question is not specific enough.
Question by
Robertus123 · Aug 24, 2014 at 02:47 PM ·
gravity
Add gravity to an 2D Object with an trigger
How can i add gravity to an 2D objectif my player approches it
Thats my code
#pragma strict
var Object : UnityEngine.GameObject;
function OnTriggerEnter2D ( other : BoxCollider2D ) {
ObjectToFall.rigidbody2D.gravityscale = 1;
}
Comment
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Turn Gravity on when collision occurs 1 Answer
Changing gravity affecting 'random movement' behaviour script - my NPCs go crazy, what should I do? 1 Answer
How can I accelerate a rigidbody towards another at X m/s? 0 Answers
hit.rigidbody.useGravity problem? 1 Answer