new Ogre::Vector3
will allocate a new vector on the heap (resulting in a Ogre::Vector3 *
, a pointer to that vector). You are trying to assign it to myPosition
, which is simply of type Ogre::Vector3
. Those two types are not compatible.
You probably don't want to use new
at all here, and instead do:
this->myPosition = Ogre::Vector3(x, y, z);
(which will assign a temporary vector to myPosition
) or just directly update the position via:
this->myPosition.x = x;
this->myPosition.y = y;
this->myPosition.z = z;