I'm trying to "pick up an object" (not using dbPickObject), and position it in front of the camera. Here's what i have until now:
void PickObj(int ID)
{
if(dbObjectPositionX(2) > dbObjectPositionX(ID)-4 & dbObjectPositionX(2) < dbObjectPositionX(ID)+4
& dbObjectPositionZ(2) > dbObjectPositionZ(ID)-10 & dbObjectPositionZ(2) < dbObjectPositionZ(ID)+10)
{
if(dbMouseClick())
{
dbXRotateObject(ID,-dbObjectAngleX(2));
dbYRotateObject(ID,-dbObjectAngleY(2));
dbPositionObject(ID,dbCameraPositionX(),dbObjectPositionY(2),dbObjectPositionZ(2)+7);
}
}
}
Object 2 is the player model which is followed by the camera. Did that by using dbSetCameraToFollow(etc). Now, the code above picks up the object but if i turn my camera left, the object remains in place. Any ideas?
Edit: dbLockObjectOn is not what i am looking for btw
! I want to do something similar to Fallout 3 object picking. Like when you are a small boy, and you play around with your teddy bear or the ball!