Jump to content
zanderuk

Setposition error

Recommended Posts

Hey,

 

I have a problem that I must say, puzzles me quite a bit.

 

when I opened my game after an update 2 months ago I recieved the error:

 

Error 1 error C2668: 'Leadwerks::Entity::SetPosition' : ambiguous call to overloaded function

 

3 IntelliSense: more than one instance of overloaded function "Leadwerks::Entity::SetPosition" matches the argument list:

function "Leadwerks::Entity::SetPosition(double x, double y, double z, bool global = false)"

function "Leadwerks::Entity::SetPosition(float x, float y, float z, bool global = false)"

argument types are: (int, int, int)

object type is: Leadwerks::Entity

 

I have no idea what to do as I have now deleted the code and tried using one of the third person templates to see if i did a mistake but I get the same error :S

 

Hope you can help me

App.cpp

Share this post


Link to post

Try changing

 

SetPosition(0, 1, 0)

 

to

 

SetPosition(0., 1., 0.)

 

and do the same for all other SetPositions

Share this post


Link to post

The error message means that the function prototypes allow double or float arguments, you are providing int's.

 

Best style might be to use 0.0 instead of 0.

 

You can also cast to float or double in some situations ie. SetPosition ( (float) someVar.x, (float) someVar.y, (float) someVar.z ), if someVar was a struct of int's.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...