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
0
Question by fadilRaditya · Aug 21, 2012 at 03:16 PM · rotationplayer

how to safe player rotation

-ask- how to save the data, for example, my player hit a cube with xyz rotation, i want to save it into a variable. this is for position data.Ycordinat=transform.position.y;

Comment
Add comment · Show 4
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 Paulo-Henrique025 · Aug 21, 2012 at 03:27 PM 0
Share

You want to save the collision point when a collision happens?

avatar image fadilRaditya · Aug 21, 2012 at 04:09 PM 0
Share

no, gameobject have position, rotation and scale, each have x y z. i want save the x y z rotation to other variable, so i can use it to other. if position is transform.position.y.

avatar image Paulo-Henrique025 · Aug 21, 2012 at 06:21 PM 0
Share

safe != save. Anyway, I think @$$anonymous$$ander got what you need.

avatar image fadilRaditya · Aug 21, 2012 at 06:32 PM 0
Share

thank you. lol, but how to access that?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Mander · Aug 21, 2012 at 05:16 PM

 var saveRotation : Quaternion;
 
 
 function OnEnterTrigger(hit : collider){
 
    saveRotation = gameObject.transform.localRotation;
 
 }
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 fadilRaditya · Aug 21, 2012 at 06:32 PM 0
Share

i have four variables Xposition, Yposition, Zposition, XYZrotation,(in other .js) i want put this when my player hit a cube (like a checkpoint)

data.XYZrotation = gameObject.transform.localRotation; player.transform.position = Vector3(data.Xposition,data.Yposition,data.Zposition); player.transform.rotation = Vector3(data.XYZrotation); either this player.transform.position =

         player.transform.rotation =Vector3(data.Xposition,data.Yposition,data.Zposition,data.XYZrotation);
       all off give me an error? any solution?
avatar image Mander · Aug 21, 2012 at 07:02 PM 0
Share

ur data script variables should be declared as static in ur data script

static var Xposition : float; static var Yposition : float; static var Zposition : float; static var XYZrotation : Quaternion;

then in the other script

data.Xposition = player.transform.localposition.x; data.Yposition = player.transform.localposition.y; data.Zposition = player.transform.localposition.z; data.XYZrotation = player.transform.localrotation;

or u could just declare 1 xyz variable at ur data script

static var XYZposition : transform;

then in the other script

data.XYZposition = player.transform;

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

8 People are following this question.

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

Related Questions

How to make a player rotate in a direction with a slope of the ground. 0 Answers

freeze rigidbody of my player 1 Answer

Rotating the player animation also rotates the player 2 Answers

Make player face different enemies with the same tag 0 Answers

How to make a flashlight (childed to the player) rotate with the player? 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