|
Hey Everybody! So I have a Ship that has a Box Collider inside it. When My player collides with the Collider, it activates an AI Script. What I was trying to do was that at the same time, have the Player Made a Child of the Ship So that it goes wherever the AI goes, until nessecary. So therefore the Player needs to be Inactive for a variable amount of time. I was using this script but instead of getting parented, the player just goes flying off the edge! Is there a different script that I should use? UPDATE! I FINALLY FIGURED IT OUT: var scriptname1 : GameObject; function OnTriggerEnter(other: Collider) { } function Update () { if (Input.GetKeyDown ("e")){ Destroy(gameObject); scriptname1.active = true; } } Thanks for all your help!
(comments are locked)
|
|
Here is the mostly Correct Script, the one thing I cannot figure out is getting out of the ship. var scriptname1 : GameObject; function OnTriggerEnter(other: Collider) { } function Update () { if (Input.GetKeyDown ("e")){ Destroy(gameObject); scriptname1.active = true; } }
(comments are locked)
|
|
Not sure but wouldn't "col.transform.parent = transform.parent;" just be "col.transform.parent = transform;"?
(comments are locked)
|
|
hallo, I use this, found somewhere here, on a trigger inside the lift and this on a trigger just when exit the lift using OnTrigerExit on the trigger is in the lift don't know why, but don't work I saw that source earlier and tried modifying it to fit my needs, but that would not work either.. Thanks Though!
Aug 09 '12 at 12:51 AM
sketchers1
(comments are locked)
|
