• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by JoeNoob · Jan 15, 2018 at 04:21 PM · positionhierarchyconfigurablejoint

Moving a set of objects does not work

I am currently working on medical research room in virtual reality. I imported a model of a head and its slices into Unity.

I orded it like this in the hierachy:

 -tissue(2)                                <--- Headmodel
 -Slices
      -X                                   <---Slice (X-Axis)
           -Handle                         <---Handle (where to grab)
      -Y                                   <---Slice (Y-Axis)
           -Handle                        
      -Z                                    <---Slice (Z-Axis)
           -Handle

I created this simple code that moves the Coordinate system of the slices according to the headmodel:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class SlicesFolloeModel : MonoBehaviour {
 
     public GameObject headmodel;
 
     // Use this for initialization
     void Start () {
         transform.position = headmodel.transform.position;
     }
     
     // Update is called once per frame
     void Update () {
         transform.position = headmodel.transform.position;
         transform.eulerAngles = headmodel.transform.eulerAngles;
     }
 }

However it doesn't work properly. I want to mention that I made the Slices configurable joints so they move in only one direction when grabbed. I made a video that explains my problem a bit further.

Your help would be really appreciated!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Brachiosaurus · Jan 15, 2018 at 06:14 PM

If I understand your intent correctly, it seems to me that the effect could achieved by making the slices the children of the head model. you can still allow them to be moved along their local axes, if you would like them to move independent of the head, like in the video.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JoeNoob · Jan 15, 2018 at 06:20 PM 0
Share

I already tried that but it doesn't seem to work neither. I thought maybe the cofigurable joints are causing problems. Is that possible?

avatar image Brachiosaurus JoeNoob · Jan 15, 2018 at 06:35 PM 0
Share

What are you using the configurable joint for? is it just to limit the x and y motion? perhaps, for the sake of simplicity, you could make a script whose sole purpose is to limit the x and y. the configurable joint may be causing problems.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

89 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Moving rigidbody children of parent rigidbody. 0 Answers

Change sorting layer of UI without changing position in hierarchy 0 Answers

Getting the position of a child in relation to an ancestor 1 Answer

Blender model position weird behavior 1 Answer

instantiate in hierarchy 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges