- Home /
Translate c script in java
Hi there, I have trouble in translating c# in js. Here is the c# version:
correctHeadRot = (Vector3)stream.ReceiveNext();
Can you help me how can I write that ,,Vector3,, in js? -Thanks
Java, javascript, c# and c are different program$$anonymous$$g languages. Don't cause misleading please.
Answer by KellyThomas · Dec 21, 2013 at 09:33 AM
correctHeadRot = stream.ReceiveNext() as Vector3;
Here is an explanation: http://answers.unity3d.com/questions/279809/how-to-perform-explicit-typecasting-in-unityscript.html
I get error: 'UnityEngine.Vector3' is a value type. The 'as' operator can only be used with reference types.
I think I will do this in c#. If I don't find any solution.
Yeah... sorry that was bad information.
Having just tested some code I think you could use:
correctHeadRot = stream.ReceiveNext();
But would receive an implicit downcast warning.
I do not understand, I thought that it would not work. Thanks so much!
Your answer
Follow this Question
Related Questions
Calling a C# function from a Javascript 3 Answers
Objectives based on object appear. 2 Answers
Javascript version of 'Mouse look' script? 1 Answer
Distribute terrain in zones 3 Answers
Help| Convert a javascript to C# 1 Answer