Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Make an object disappear based on movement.

Discussion in 'Editor & General Support' started by josedasilveira, May 9, 2021.

  1. josedasilveira

    josedasilveira

    Joined:
    Apr 29, 2021
    Posts:
    7
    Greetings,
    I'd like to make an object dissapear when another starts moving. How do I do it? My guess is that I need to reference transform in the script in some way.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,336
    Start with some basic youtube tutorials for the parts involved:

    - how to detect whatever you consider "another starts moving." You might measure the magnitude of the speed of that "another" to consider if it is moving or not.

    - how to make objects disappear / reappear based on any particular condition

    When you have the two parts above working, wire them up so that the first causes the second.
     
  3. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,315
    What are you actually trying to accomplish? This smells like an XY problem.