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 /
avatar image
0
Question by godfreyidk · Apr 02, 2018 at 09:52 AM · directionworldlocalspace

What is the difference between transform.up and Vector3.up?

I'm assuming transform.up is the direction pointed in by the z-axis of the transform of a game object. But what about Vector3.up? Is Vector3.up the direction pointed in by the world z-axis?

Please someone, help me out.

Thanks, and much love!

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 Hellium · Apr 02, 2018 at 12:46 PM 0
Share

How about reading the documentation

Transform.up

The green axis of the transform in world space.

$$anonymous$$anipulate a GameObject’s position on the Y axis (green axis) of the transform in world space. Unlike Vector3.up, Transform.up moves the GameObject while also considering its rotation.

When a GameObject is rotated, the green arrow representing the Y axis of the GameObject also changes direction. Transform.up moves the GameObject in the green arrow’s axis (Y).

1 Reply

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

Answer by Kishotta · Apr 02, 2018 at 10:12 AM

Vector3.up refers to "Global up". No matter where you are, how you look at it, Vector3.up will always be the value <0, 1, 0> (the normalized positive y-axis direction).

transform.up, on the other hand, changes with respect to the transform in question. If I have the transform of a tree that has fallen on the ground, the tree's "up" direction (toward's the leaves) is no longer "up" in regards to how we might stand on the ground.

If you want to do more reading on the subject, I suggest you do searches for global vs local space vectors.

Comment
Add comment · Show 5 · 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 godfreyidk · Apr 02, 2018 at 10:26 AM 0
Share

Thanks @$$anonymous$$ishotta,

That's clear enough, but just to be sure that i understand your explanation. If the tree's transform.up was initially aligned with Vector3.up (the global up), and the tree fell over forward, then would that mean the tree's transform.up (its normalized positive y-axis) is now aligned with the Vector3.forward (the global forward - that is, the global "normalized positive z-axis")?

avatar image meat5000 ♦ godfreyidk · Apr 02, 2018 at 12:48 PM 1
Share

Sounds right. Its just World vs Local axes.

avatar image godfreyidk meat5000 ♦ · Apr 02, 2018 at 02:30 PM 0
Share

Okay, thanks for acknowledging that for me.

avatar image Kishotta godfreyidk · Apr 03, 2018 at 12:17 AM 1
Share

Correct. Initially, with the tree perfectly "upright", the two up vectors are identical. When the tree falls though, the tree transform's "up" will drift farther and farther away until it lands on the ground (not necessarily flat, you could use Vector3.Angle (transform.up, Vector3.up) to get the actual angle difference).

avatar image godfreyidk Kishotta · Apr 03, 2018 at 10:51 AM 0
Share

Huge thank you, you've been a great help. Cheers

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

80 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

Related Questions

Simple Transform question, using Quaternion.LookRotation 0 Answers

Mesh won't travel in direction it's facing 1 Answer

Question about finding out edges of a box collider 0 Answers

A way to convert Relative direction to world? 1 Answer

Set a sun light (Day Night Cycle) 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