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 PixelFireXY · Dec 21, 2012 at 07:01 PM · positionscreenblacknan

Strange bug, black screen and invalid input position NaN error

Hi, im working on puzzle game in multiplayer and works all well(about all =) ), anyway when i try my game on my computer, i launch editor and pc, mac & linux standlone .exe, all seems to be fine except when i press 'w' or 'a ' or 's' or 'd' movement key in exe for move player, then black screen in game appear immediately on editor and it show this error message:

transform.position assign attempt for 'Player(Clone)' is not valid. Input position is { NaN, NaN, NaN }.

UnityEngine.Transform:set_position(Vector3) MovementUpdate:UpdateMovement(Vector3, Quaternion) (at Assets/scripts/Network Scripts/MovementUpdate.cs:72) not change nothing if i make vice-versa(client/server - server/client), ever if i press any movement button key, black screen appear and error message is printing(black screen appear only in exe, editor works perfectly in all two case) I try another solution, i build exactly same project in web player, and this time works both(client/server - server/client), without black screen and errors. There is my pc info: - Windows 7 Home Premium Service Pack 1 - HP Pavilion dv6 Notebook PC - Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz 2.00 GHz - 4,00 GB RAM - 64 bit - Kaspersky PURE And this is the script that give me error:(only in exe, of course) using UnityEngine; using System.Collections;
/// /// This script is attached to the player and it /// ensure that every players position, rotation, and scale, /// are kept up to date across the network ///
public class MovementUpdate : MonoBehaviour {
//Variables Start_
private Vector3 lastPosition; private Quaternion lastRotation; private Transform myTransform;
//Variables End
__
// Use this for initialization void Start () { if (networkView.isMine) { _myTransform = transform;
//ensure that everyone sees the player at the correct location //the moment they spawn networkView.RPC("UpdateMovement", RPCMode.OthersBuffered, _myTransform.position, _myTransform.rotation); }
else { enabled = false; } }
// Update is called once per frame void Update () { //if the player has moved at all then fire off an RPC to update the players //position and rotation across the network
if (Vector3.Distance(_myTransform.position, _lastPosition) >= 0.1f) { //Capture the player's position before the RPC is fired off and use this //to determine if the player has moved in the if statement above
_lastPosition = _myTransform.position;
networkView.RPC("UpdateMovement", RPCMode.OthersBuffered, _myTransform.position, _myTransform.rotation); }
if (Quaternion.Angle(_myTransform.rotation, _lastRotation) >= 1) { //Capture the player's rotation before the RPC is fired off and use this //to determine if the player has turned in the if statement above
_lastRotation = _myTransform.rotation;
networkView.RPC("UpdateMovement", RPCMode.OthersBuffered, _myTransform.position, _myTransform.rotation); } }
[RPC] void UpdateMovement(Vector3 newPosition, Quaternion newRotation) { //print(newPosition.ToString()); //print(newRotation.ToString()); transform.position = new Vector3(newPosition.x, newPosition.y, newPosition.z);
transform.rotation = new Quaternion(newRotation.x, newRotation.y, newRotation.z, newRotation.w); } } Thanks for help, i dont know what i can i do. S:
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
0

Answer by PixelFireXY · Dec 27, 2012 at 10:17 PM

anyone knows how to fix this problem? :(

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
0

Answer by someone13 · Dec 31, 2013 at 02:24 PM

I was getting this issue in build versions of my game. Check to see if your build has a corrupted resources.assets file. If it does, fix it. The fix for mine, was that I had multiple script files with the same name in both JS and C#.

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

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

10 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

Related Questions

Position GameObject to Bottom Left Corner 2 Answers

A node in a childnode? 1 Answer

World to Screen 1 Answer

How to get the screen position in an unlit shader. 1 Answer

Unity issue when displayed on 2 screens (OS X) 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