• 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Problem instantiating a prefab, and storing a reference to it. 1 Answer

How to instantiate an object on multiple positions? 0 Answers

Intantiated objects being created but being invisible...[PICTURES] 1 Answer

When attempting to place an object from prefab, the object continually jumps up to the camera and back down quickly. 0 Answers

Argument Exception: The Object you want to instantiate is null (A new one?) 2 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