Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • 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 puelo · Jan 01, 2012 at 11:36 PM · positioneuleranglesbone

Cannot move or rotate child Object

I have an odd problem with Unity. I got a Swords Prefab and a Character with a sheath on the back. The sheath has a bone where the sword should be.

Now i parent the Instantiated Sword Object to the Sheath bone, which works just fine (i think?!). Now i have to Rotate the sword for 90degrees so that it fits perfectly in the sheath. But i cant change the rotation or position of the sword in the script. I`ve tried localPosition, position, rotation, localRotation, eulerAngles, localEulerAngles, nothing works. I can rotate the sword in the scene - view though. The sword model was imported from blender...is it important wich pivot i use there? Or could something different went wrong there?

Here is the important part of the script:

 public Transform Swords;
 public Transform rightSheath;
 
 void Awake () 
     {
 
         Transform swordR = (Transform)Instantiate(Swords, rightSheath.transform.position, rightSheath.transform.rotation);
         swordR.transform.parent = rightSheath;
         movement.direction = transform.TransformDirection (Vector3.forward);
         controller = GetComponent<CharacterController>();
         Spawn ();
     }
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

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by kievar1983 · Jan 02, 2012 at 12:01 AM

it sounds like the game is not finding your object, can you move the object around on the screen? I'd try to do that before any rotation. also most likely with the rotation unless you know the precise math behind it you are probably going to want to use matrix or quaternion rotation and not a locale rotate or rotation.

Comment
Add comment · 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
0

Answer by puelo · Jan 02, 2012 at 12:18 AM

I see the sword on the back of my character when i start the game. When i switch to sceneview i can select it and rotate / scale and reposition it, without problems. I will maybe try to delete the prefab and reimport everything..

Comment
Add comment · 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
0

Answer by puelo · Jan 02, 2012 at 12:17 AM

i tried to import the sword once again with other rotation and was able to import it so the rotation fits to the Sheather......nevertheless the problem with me not able to rotate the object in the script is still present...what do you prefer to use to rotate the Object to a certain angle?

Comment
Add comment · 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
0

Answer by puelo · Jan 02, 2012 at 02:55 PM

It seems that i am not able to move the Object at all, even if its not parented.. Its not static.

Comment
Add comment · 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
0

Answer by fateshow · May 07 at 04:04 PM

I'm having the same issue but haven't found the answer yet.

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

How to solve weird rotation problem? 1 Answer

Animated object changes position when animation is played. 1 Answer

Dynamically Update Instantiated Objects Position 1 Answer

Camera rotation around player while following. 6 Answers

Using dummy as an attachment point for handgun 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges