About 'Resetting the Game'!

gdt_s05_resetting_the_game

#1

In this video (objectives)…

1 Freeze the ball and players when a goal is scored 2 Reset the ball and player positions after some time has passed

After watching (learning outcomes)…

Using Axis Lock to immobilise objects

(Unique Video Reference: 11_CK_GDT)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!


#2

Hi,

I have a question about resetting the balls physics after the pitch is reset after a goal. I have the issue that the balls velocity that it was traveling at when it went into the goal is still being applied after the ball and the players positions have been reset. it makes sense the physics engine would assume it is still moving but I would like to stop it.

Is there an easy answer for this? I have tried setting the linear velocity to Vector3(0,0,0) but that didn’t help. I am wondering if there is a way to clear the physics engine. I am sure freeing the ball and recreating it during each reset will work…or applying a reversing force… just wondering if there is something easier I am not aware of… or if I even missed something while watching the video?

Cheers!


#3

I managed to resolve the problem by removing the ball from the scene, freeing it and creating a new ball scene instance.

Not sure if this is the best way? I would like to think there is a nicer way to reset a physics object state.