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

First project. I know the what. Now for the best how.

Discussion in 'Game Design' started by unity_wOaDwAFVb1PNNA, Feb 13, 2021.

  1. unity_wOaDwAFVb1PNNA

    unity_wOaDwAFVb1PNNA

    Joined:
    Jan 30, 2021
    Posts:
    4
    The idea is a temple exploration game where the player will have to avoid traps.

    When the player enters a certain area I want there is a an audio and visual clue that a trap is about to trigger. Then spike from the wall come out

    To do this I was thinking of creating either an empty object in the space to act as the trigger, or making a section of the floor the trigger.

    On trigger the trap arming sound effect plays.
    For the spikes I was thinking I would place it inside the wall and slightly move them out so that the tips can be seen when the player enters the trigger. To do this I would use a transform.Translate script

    then after a short time delay the spike come out and if the player is in the area kills them, otherwise they slowly go back into the wall. Again using transform.Translate.

    Is this an efficient way to get the desired effect? I’m worried about having issues with the spikes being inside the wall.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,842
    This forum (Game Design) is about what, not how. How questions belong in Editor & General Support, or maybe Scripting, depending on where the difficulty lies.

    Your approach sounds fine to me. There are no problems from having objects inside of other objects, unless maybe when you're using physics (which you shouldn't be in this case).
     
  3. unity_wOaDwAFVb1PNNA

    unity_wOaDwAFVb1PNNA

    Joined:
    Jan 30, 2021
    Posts:
    4
    Ah, sorry for posting in the wrong spot. Thanks for the response. I’ll make sure to post in a more appropriate forum next time.