get_pos() values giving odd results (C++) [Solved]

I loaded a model (NodePath) and set a CollisionSphere’s center to the model’s get_pos. When i move my player, i calculate the amount of movement in x,y,and z directions and use the function .set_pos(NodePath, x, y, z) to set the model’s position. Then i set the CollisionSphere to this model’s get_pos() values.

When i use the show() function to see the CollisionSphere, it seems to move further than my model. Any idea on what’s causing this?

If the CollisionSphere is parented to the model, it will inherit the model’s position. The center is then relative to that model’s position, so if you are setting the same position again on the sphere’s center, you are just moving it further away from your model.


aah yes that solved my problem :smiley: thanks again david~