Search Unity

Question Collision Trigger for Score Tracking

Discussion in 'Physics' started by MrSCooke, Dec 27, 2023.

  1. MrSCooke

    MrSCooke

    Joined:
    Aug 18, 2023
    Posts:
    5
    Unsure if this is the appropriate spot to post this, but I'm struggling with my collision triggers to implement a scoring system for my game. What I want is for the score to update by 1 for each asteroid that the player spaceship successfully avoids. I've tried visual scripting methods that I've come across online and even the C# script that I included in a screenshot but nothing has worked so far.

    Also included a screenshot of the Offscreen collider I've created right below the spaceship game object itself. The goal of that was to be a point of where the asteroids collide with it, then it destroys the asteroids offscreen and adds +1 for each that's destroyed. ANY help would be greatly appreciated.


    Screenshot (46).png Screenshot (47).png
     
  2. ReoCyan

    ReoCyan

    Joined:
    Sep 25, 2023
    Posts:
    35
    The object that is moving needs a rigidbody* and a collider. If you don't have any of these fix it. If not show me the rocket.

    *Static rigidbodies are not viable