Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by siddharth3322 · May 13, 2015 at 04:13 PM · transformvector3directionup

Difference between Vector.up and transform.up

Basically my question title says everything related to my question. What is the difference between Vector.up and transform.up?

If I have asked silly question then forgive me but at present I can't able to understand these two terms. Please give some suggestion in this.

EDIT : Whether it create any difference if we use anyGameObject.transform.up?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
5
Best Answer

Answer by fafase · May 13, 2015 at 04:37 PM

Vector3.up is constant and corresponds to the world up so (0,1,0). It is the yellow arrow on hte gizmo in the scene view.

tranform.up corresponds to the yellow arrow on the object and is related to it. As you rotate your object, the gizmo on the object moves and all three arrows change direction (not magnitude, always 1). transform.up, right and forward gives you the vector to which they correspond in world space.

So if no rotation, all three are equal to their world equivalent but as you start rotating, they change. In the case of a character, it is most likely rotating around its transform.up so that vector actually never change.

Got it?

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
2

Answer by tebandesade · May 13, 2015 at 04:20 PM

Hi well first of all vector is (x,y,z) an other words a normal vector. Therefore, it will indicate to go up 1 pos in the Y axis. On the other hand, transform has three componentes as well, x,y,z. Nonetheless, the transform could be placed not in the normal (x,y,z) pos we know, but locally it can differ for instance maybe the transform of a gameobject of mine is rotated 90 degrees to the right, therefore the Y transform will be the X vector wise and so on

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 tebandesade · May 13, 2015 at 04:41 PM 1
Share

It will create any difference if your Gameobject's transform is rotated compared to the normal Vector (x,y,z) position . Look at the green arrow( Y's transform position -"up") alt text

It is as a normal vector right? If you do transform.up it will be the same as Vector.up because both are pointing towards the same direction. Yet, if your transform rotates like this alt text

See that the green arrow is pointing right, that is your transform's y coordinate so if you do transform.up it will be the same as doing vector.right.

captura-de-pantalla-2015-05-13-a-las-113905-am.png (19.7 kB)
captura-de-pantalla-2015-05-13-a-las-113900-am.png (21.2 kB)

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

20 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

Related Questions

InverseTransformDirection and TransformDirection 1 Answer

Why are my player's positions not being set correctly? 1 Answer

Perpendicular Vector3 0 Answers

Raycast between TransformDirection and Vector3.Forward? 1 Answer

How to rotate an object to face the direction it's going? 1 Answer


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