Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

No appropriate version of 'UnityEngine.Transform.RotateAround'

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 PointInSpace   Members   

102
Like
0Likes
Like

Posted 22 July 2013 - 05:18 PM

I'm getting this error:

 

 Assets/CircularOrbit.js(11,26): BCE0023: No appropriate version of 'UnityEngine.Transform.RotateAround' for the      argument list '(UnityEngine.Vector3, System.Type, float)' was found.

 

Here is my script:

 

#pragma strict
 
function Start () {
 
}
 
function Update () {
   var mountain : GameObject;
// This will return the game object named Hand in the scene.
   mountain = GameObject.Find("QuantumCold_B");
   transform.RotateAround(mountain.transform.position, Vector2,20 * Time.deltaTime);
   
}
 
What I am trying to do is circle around a mountain object which is a mesh.  


#2 shazen   Members   

291
Like
0Likes
Like

Posted 22 July 2013 - 06:11 PM

the 2nd parameter looks wrong. Instead of just Vector2, try Vector3.Up,

 

The 2nd param is the axis that the rotation is to be around. that axis must be in 3d space so it needs a Vector3. Most likely, you want Vector3.Up for it.



#3 Oberon_Command   Members   

5918
Like
0Likes
Like

Posted 22 July 2013 - 06:13 PM

transform.RotateAround(mountain.transform.position, Vector2,20 * Time.deltaTime);

 

I'm going to guess that the bolded part is supposed to be the rotation axis? If so, you should actually pass it an axis, ie. an instance of a Vector3. Right now you're passing it the type Vector2. RotateAround() expects two Vector3s and a float, and right now you're giving it a Vector3, a type, and a float, just like the error message says.

 

Next time you can solve something like this more quickly by reading what the error message is saying. If you compared the error message to the actual function signature of RotateAround (found here), I think you would have spotted the problem pretty quickly. Error messages are there for a reason. ;)


Edited by Oberon_Command, 22 July 2013 - 06:15 PM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.