Game Development Community

Respawning with a Delay

by Sharpie · in Torque X 3D · 04/28/2010 (9:41 pm) · 3 replies

Okay, so I've finally gotten my soccer field, ball, and player all interacting very nicely. I've gotten collision on the goals, and all is going well. My next question is how to respawn the ball once it's been kicked into the goal. Also, I'd like it to do so after a delay. So like...I'd like it to bounce around in the goal for at least a couple seconds before killing it and respawning. I'm not quite sure how to do either, though. Any help would be awesome! Thanks much. :)

#1
04/29/2010 (10:05 pm)
I've figured out the spawning and deleting aspects. When the ball enters the goal, it disappears and a new one appears back at the center of the field. Problem, though, is that I'd like that to happen after a delay. Right now it's instantaneous, which is a little annoying. Any advice would be awesome, thanks! :)
#2
04/30/2010 (10:01 am)
So now I've figured out the delay feature. A little confusing for awhile there, but it works beautifully now. :)

Next thing I'm wondering is about respawning my player. I'd like the option of doing so, but when I create a new player and delete the old one, the camera does not follow. Any ideas on how to get rid of the old camera so that the new one can have control?
#3
04/30/2010 (12:25 pm)
Did you do the tutorials, In the Space Warrior tutorial they have some respawning code that I adapted for my use.