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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to find positions and rotations intervals for spawn

Discussion in 'Getting Started' started by Gibser, Jan 31, 2023.

  1. Gibser

    Gibser

    Joined:
    Dec 15, 2020
    Posts:
    10
    Hello!
    I'm trying to find intervals of positions and rotations to spawn the cup in front of the hand so that it is graspable (The cup is child of the hand).
    The problem is that I'm moving the mug in the editor in order to find good rotations and coordinates, but sometimes if I move the object along a direction, the other coordinates (or angles if I rotate) also change. Is there an easier way to find ranges of points and rotations in this case?

    Scene: https://imgur.com/a/jEADObi

    Thanks in advance
     
    Last edited: Jan 31, 2023
  2. AngryProgrammer

    AngryProgrammer

    Joined:
    Jun 4, 2019
    Posts:
    437
    You have two types of directions you are facing: local and global. There is switch in editor of that (you will see difference in arrow direction with moving tool).

    More simple solution is just create empty game object in hierarchy of hand. Name it as Spawner and when you instantiate cup put in the method position and rotation of spawner. He will be always on the right place.
     
  3. Gibser

    Gibser

    Joined:
    Dec 15, 2020
    Posts:
    10
    Sounds reasonable, thanks!