Need help in unity….

Updated on October 25, 2018 in General
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on October 24, 2018

New to unity and still kearning. My object keeps flying over in the opposite direction after a collision istead of coming to a standstill, and the score keeps going after the object falls off from the plane…. Open to all suggestions and solutions…

  • Liked by
Reply
1 on October 25, 2018

 

If the score keeps on going, then you could try this:

Create an empty gameobject and add a box collider to it.

Place it below the platform.

Then, you can add a tag to it named “DestroyZone”

If the score is being updated by the player or if the player is still not destroyed, this is bound to work. 
Put this code on the player and make sure that the box collider of the “Death Zone” is set to trigger.

public void OnTriggerEnter(Collider other)
 {
 if(other.CompareTag("DestroyZone"))
 {
 Destroy(gameObject);
 }
 }

Also if you are new to unity, check this out. The tutorials are free and very nice:

https://unity3d.com/learn/tutorials

Good luck!

on October 25, 2018

Thanks a lot AlextoCharArray

Show more replies
  • Liked by
Reply
Cancel