Search Unity

How can I make the player place and rotate objects in specific areas?

Discussion in 'Scripting' started by UndeadMadison, Jun 6, 2020.

  1. UndeadMadison

    UndeadMadison

    Joined:
    Apr 16, 2020
    Posts:
    15
    Hello! I have been searching around for a good bit trying to find a way to do this. I am still new to all the code functions and things within C#. I am learning more efficient ways as I go along but this is one thing that is making me draw a blank and I can’t find anything on it.

    I have no code because I don’t even know how to do this. Here is what I am trying to do.

    The player is a first person character with a controller I made from scratch. I want the player to be able craft, have an object in their inventory and be able to press the place option which will bring up the object that the player can carry around, rotate and place anywhere in a specific space. The player is able to carry walls and all kinds of stuff but I want the objects to attach automatically to the ground or be able to be stacked on top of each other then if the player tries to place it outside of the space it denies it. I finished my inventory script, it isn’t great but it works and I am working on the craft script so all that I am good with I just need help with the whole moving, place, rotate and all that.

    I have started so many projects all because I get stuck on something and no matter how hard I look I vent find it so I start a new game. I really want to get through with this game and actually complete it cause I am very excited for this one.
     
  2. Cyber-Dog

    Cyber-Dog

    Joined:
    Sep 12, 2018
    Posts:
    352
    Honestly mate, by the sounds of things you need to learn before you can make stuff. And you cant learn of the forums completely. I really suggest you start doing some tutorials and make complete games that way.

    https://learn.unity.com/projects

    The reason I say this is because what you ask is fairly simple, and also easily google-able with many results. But you don't know how to properly ask or search for the answer.