3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Destroy created Rigidbody by imposter  (Read 178 times)

« on: April 12, 2014, 12:01:12 PM »
Hi.

I wrote a script for detach gun from the car. I want after detach gun, hidden it when falling. I can solve this Problem with two issue:

1. No attach gun (as rigidbody) to terrain that after collide with terrain, Fall to it and hidden. but with this work I have a Problem, when more than 7 times rigidbody fall to terrain, stay in air and no fall to terrain.

2. I can use enventoncontact object for monitor rigidbody and Terrain and after collide together use below script for hidden rigidbody.
Code: [Select]
if (IN_0 > 0) iObjectHide(OBJ_22);but also with this way have a Problem, rigidbody is hide, but contact with terrain is always is 1 and make script work once.

Please Guide Me.

Thanks A Lot
« Last Edit: April 12, 2014, 12:03:23 PM by behdadsoft »
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #1 on: April 12, 2014, 02:14:07 PM »
1 possible solution - Don't link the the rigidbody to the terrain and don't use an event on contact, use the y axis position of the rigidbody - when less than your defined height destroy it or pin it to a location under the map - less resource and reliable.
Still don't see why you're using imposters for this if there is only ever one gun in the game at a time though
« Reply #2 on: April 15, 2014, 10:10:26 AM »
Thanks Cypermethrin and sorry for the delay in response.

I could fix this Problem with your guide. but I used EventOnContact and below script.

Code: [Select]
Vector3 Rigid;

void Main()
{
   if (iInitializing()) iObjectLocation (OBJ_22, Rigid);
   iObjectLocationSet (OBJ_22, Rigid);
   if (IN_0 > 0 && Rigid.y > 1)
   {
      iObjectHide(OBJ_22);
      Rigid.y -= 0.1;
   }
}

Quote
Still don't see why you're using imposters for this if there is only ever one gun in the game at a time though

my game is like crash or blur game, but the difference is my game have gun for shoot. and in every level at least there are three types of guns and at a same time every car can have 2 attached gun.I think should use imposter.right?

Thanks A Lot
« Last Edit: April 16, 2014, 03:07:58 AM by behdadsoft »
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
Pages: [1]