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 remy_rm · Jan 30, 2017 at 03:38 PM · instantiate prefab

When i instantiate a new OVRPlayerController its forward is off

In my game you control a main character which is able to summon shapes and move these around as new characters. looking around is done with the oculus rift and moving with WASD using the oculus OVRPlayerController.

When i summon a shape from the main character and take control of it the camera forward and the movement forward do not align anymore. But this only happens if i rotate my main character before instantiating the shape, if i look straight forward (e.g directly after starting the game) they do align.

cube = Instantiate(cubePreFab, new Vector3 (mainCharacterController.transform.position.x, mainCharacterController.transform.position.y, mainCharacterController.transform.position.z + 5), mainCharacterCameraRig.transform.rotation) as GameObject;

i have tried to use Quaternion.Identity aswel but with the same result. OVRManager.display.RecenterPose(); doesn't solve it either, this will only make the camera move to its center pose, but the forward is still askew, i tried setting the forward with transform.Rotate and transform.rotation but that didn't help either.

thanks in advance for any suggestions, if you require any more information/scripts just ask.

Comment
Add comment · Show 2
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 wearvr_olli · Mar 12, 2017 at 03:19 PM 0
Share

same problem. Did you find a way? The weird part is that when i pull it from the inspector of the editor to the scene it works..

avatar image remy_rm wearvr_olli · Mar 13, 2017 at 02:08 PM 0
Share

sadly i have not been able to get a solution to the problem, i worked around the issue by restricting the movement of the player while summoning the new character so the look and movement angles will always line up

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to replace prefab at the same location? 1 Answer

Instantiated Object does not fall 3 Answers

Im trying to instantiate prefab from an array but get a confusing response...(this prefab will be consumed by the player meaning it needs to be instantiated multiple times) 2 Answers

Prefab attached to script is destroying itself before Instantiate() is called 1 Answer

Spawn a prefab off screen? 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