thpsX

- => Questions & Tutorials => Topic started by: rudi246 on April 17, 2019, 10:11:15 am

Title: Help with bouncy objects
Post by: rudi246 on April 17, 2019, 10:11:15 am
So I'm having trouble adding some bouncy objects to my levels. I have models for tables and chairs that I want to be bouncy objects but evertime I hit them in the game, it crashes the game. The only thing that I've tried that didn't crash the game was just a cube. Is there some sort of polygon limit for bouncy objects? Also, it never plays the sound effects for the objects. Any helpis appreciated.
Title: Re: Help with bouncy objects
Post by: Skater1014 on April 21, 2019, 01:05:27 am
Yeah if it crashes when you touch it then that usually means that you have to lower the polys of the object's collision mesh.
You can lower the polys of the collision mesh without lowering the object's polys in general by making the object have a separate collision mesh.
You can make the object have separate collision mesh by duplicating the object (make them have the same name) and adding "_SCN" to the end of one of the object's names (the one with "_SCN" at the end will be the actual mesh of the bouncy object while the one without "_SCN" will be the collision mesh.).

For sound effects idk how it's normally done but a workaround is to give the bouncy object a script like this:
Code: [Select]
:i $Obj_Playsound$$[SOUND FILE NAME HERE]$
And use loadsound in "_STARTUP" to load the sound file on level load.
Code: [Select]
:i $LoadSound$ %s(0,"[PATH TO SOUND FILE HERE]")
Title: Re: Help with bouncy objects
Post by: rudi246 on April 22, 2019, 10:43:10 pm
Thanks! I put a box around the chair and made it the collision mesh. Now the game doesn't crash, but they always sink into the ground and spin on the center point rather than tipping over. I tried messing with all of the different values but couldn't seem to get it to behave like the other chairs in the game.