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

Question Building in Unity

Discussion in 'Prefabs' started by UgurUmud, Jul 10, 2023.

  1. UgurUmud

    UgurUmud

    Joined:
    Feb 12, 2023
    Posts:
    1
    Hello everyone, I'm new to Unity3D and I want to create a building system similar to Minecraft. I would like the blocks (prefabs) to spawn in the direction the player is facing. Additionally, I want to be able to detect which prefab the player is currently standing on, and when the player presses the "B" button, I want to spawn a new prefab based on the one the player is standing on. The new prefab should appear in the direction the player is looking, right after the prefab they were standing on.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Using raycasts you can detect what's below you
    For the spawning, look up guides, I know there are many on youtube
     
    UgurUmud likes this.
  3. ijmmai

    ijmmai

    Joined:
    Jun 9, 2023
    Posts:
    188
    Sounds like a fun game. Did you get the basics working already?