Help|Change Mesh

Hey sup guy’s?
Listen p,
i want to make now an crashes aplication with car so…
how can i change the mesh of the car when the car object touch on some else object?
can i do that?
or i need to do the mesh crash with too mesh of the fix mesh car (the clen mesh)?
TNX for help.

Translation :

Hello there fellow connaisseurs of coding present within the unity 3d scripting community. How are you faring this fine day? Please advise me on the following quandary I am having. I wish to program an application ( or ‘program’ for you more traditional programmers ) which features automobiles colliding with objects and have them realistically deform. How would I go about changing the mesh of said automobile when it collides with another object? Is this possible within the constraints of unity 3d? How would I go about doing that? [unintelligible] Thank you very much for your assistance in regards to this matter.

My answer :

Yes, it is very much possible to both change the mesh of an object, or even deform a mesh at realtime within unity. There is an excellent example of this here : http://forum.unity3d.com/threads/65507-Unity3D-RealTime-crash-car! Ah, though I have seen you have already seen that. My bad. There are several different ways of approaching it. If you wish to do runtime deformation, I’d check out this link : Unity - Scripting API: Mesh it explains quite a bit. If you are just looking to simulate a collision, you could just delete the old object on collision and replace it with an instantiated damage car.
I have no idea what your penultimate sentence says however, so can’t advise on that. Good Luck :slight_smile:

mybe you have a object game to explane?
EDIT:
i tryed what (the example) you give me.
i try it’
but it’s doesn’t work’
i doesn’t see how the script can to help me (i doesn’t see some place to put the car mesh (the dirty mesh) in the script O.O…

mybe you have a object game to explane?
EDIT:
i tryed what (the example) you give me.
i try it’
but it’s doesn’t work’
i doesn’t see how the script can to help me (i doesn’t see some place to put the car mesh (the dirty mesh) in the script O.O…

Translation:

Hello there fellow connaisseurs of coding present within the unity 3d scripting community. I seem to have waylaid my make game function library, and would someone be so kind to code my game for me.

My answer:

http://unity3d.com/support/documentation/ - Please follow all the tutorials, all of them.

The world needs help…

dude can you just give me the script that change the Shape of the mesh.
or script that change the mesh to another mesh?
TNX a lot if you will do that!

Instantiate(damagedCarPrefab, niceLookingCar.transform.position, niceLookingCar.transform.rotation)
niceLookingCar.Destroy();

Also, [quote=“hippocoder, post:5, topic: 427180, username:hippocoder”]
http://unity3d.com/support/documentation/ - Please follow all the tutorials, all of them.
[/quote]

Hi KillerScript, dude has a name ( Mr. Dude ) and don’t expect the community to write your scripts. Search the forum and go through some of the tutorials and try make something. If you show effort, the community will be glad to help.

TNX FizixMan and TNX Apples.
Apples,
I tryed this but i have error:

what is your error ?

Mesh (mesh1, mesh2) doesn’t have a property “Mesh”, or a property “enabled”.

so how can i fix it?

As said above, the community is more than happy to help if you put some effort in. They arn’t here just to write scripts for you :slight_smile: I would really start by going to the tutorial links above, and following them through - it will give you a much better understanding of unity and scripting and maybe you can solve the issue yourself.

If you arn’t getting the mesh idea, and just want to perform a nice car/damaged car then FizixMan’s solution sorts out the problem nice and easily.