Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by TKDHayk · Jun 14, 2016 at 10:36 PM · scripting problemtransformchild objectparent transform

how to access the Transform of a moving child object?

I have an FPS controller with an empty child called "BulletSpawn", which is supposed to serve as the spawn points for instantiated projectiles. When I instantiate a projectile and set its position and rotation equal to "BulletSpawn", I do not get the intended result. This is because the transform of "Bulletspawn" under the inspect does not update at all. It moves correctly in relation to the parent FPS controller, but its transform values do not change while moving across the map. I have tried a couple different solutions and have a couple more ideas but I believe there should be a simple and clean solution to this. Please let me know if you can help because I'm approaching a deadline! according to the documentation, transform.position is the global/absolute transform value, and yet this does not seem to be the case, since transform/position and transform.rotation values stay the same in the inspector while moving all over the map. Is this a bug or am I missing something?

hayk

Comment
Add comment · Show 1
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 Kazakon · Jun 15, 2016 at 02:05 AM 0
Share

If i'm not wrong, the transform component in the inspector of your child is displaying relative position/rotation to your parent object. When you attach objects to other objects, the transform component displays the relative position/rotation to its parent.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TKDHayk · Jun 15, 2016 at 02:10 AM

Perhaps, you mean transform of a child is actually localtransform? Is there a way to access the global transform of a child?

Comment
Add comment · Show 1 · 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 Kazakon · Jun 15, 2016 at 02:24 AM 0
Share

I'm not really sure because i'm still kind of new to this, perhaps if you post the part of your script that you are using to instantiate the object, it would be clearer what is the problem you have with spawning.

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

72 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

Related Questions

Firing projectile from Transform. What am I doing wrong? 1 Answer

reset a GameObject parents childs to 0 if a item has changed its parent 2 Answers

Following object (arrow) slides off of a object 1 Answer

How to change rotation for a FirstPersonController through script. 0 Answers

Gameobject transform not moving when doing animation 0 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