- Home /
Falling plane physics problems
Hey guys, i'm making an island game and in the begining, a guy falls from a plane. The problems are simple (i think), but i'm a newbie. Well, the problem is shown in the below link of a video: http://www.infosecom.net/planefalling.mp4
That is not completed yet, i want to make the helix, and other parts of the plane to detach from the plane hierarchy and add a rigidbody to them when it collides. I'm using these scripts:
The script below deactivates the waypoints script so the plane dont follow the waypoint and starts to fall cuz it has a rigidbody attached to.
function OnCollisionEnter () {
var wayPoint = gameObject.GetComponent("WayPoints");
wayPoint.enabled = false;
audio.Play();
}
The following script detaches the parts of the plane like tail, helix, helm and other parts when these parts collides with the mountain shown in the video above.
function OnCollisionEnter () {
gameObject.AddComponent("Rigidbody"); transform.parent = null;
}
I've tried to use Transform.DetachChildren, but i don't know how to use it.
The hierarchy is that: http://www.infosecom.net/hierarchyscreenshot.png
It's that, any tips or tricks you have to the game, like, you can put this in the plane, that in the mountain and etc. Thanks!
Seems like the video link is dead. What's the problem you're encountering?
A common way to do what you want is to instantiate a whole new game object, but already broken into pieces. In other words, destroy your aircraft and instantiate an exact duplicate with the pieces not parented. It'll be easier to add things like smoke trails, explosions etc.
Your answer
Follow this Question
Related Questions
"Invalid AABB" error whenever rigidbody moves 7 Answers
2D 360 degress platformer example needed 0 Answers
What is the velocity on a given axis of a rigidbody? 2 Answers
Instantiating Rigidbodies on PhotonNetwork? Am I doing it wrong? 1 Answer
Problem with physics: GetPointVelocity & AddForceAtPosition (airplane control script) 2 Answers