Sunday, 24 January 2016

Unity : How to enable gravity on GameObject

Unity : How to enable gravity on GameObject



























DIRECT DOWNLOAD HERE






THIS IS BACKUP  IN TEXT FORM  

This one script  enable Gravity...

1. Create New java and name it : wht you like...

2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-

#pragma strict

var Obj : GameObject;

function Start () {

Obj.SetActive(true);

}

function OnTriggerEnter (trigger:Collider) { if(trigger.collider.tag=="Player") 



Obj.rigidbody.useGravity = true ;

}
 







 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-










THIS IS BACKUP  IN TEXT FORM  

This one script  disable Gravity...

1. Create New java and name it : wht you like...

2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-

#pragma strict

var Obj : GameObject;

function Start () {

Obj.SetActive(true);

}

function OnTriggerEnter (trigger:Collider) { if(trigger.collider.tag=="Player") 



Obj.rigidbody.useGravity = false ;

}
 







 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-











0 comments:

Post a Comment