For now, you can just go into the Camera class, and replace the four lines that set the camera in the update with these two:
Code:
C OrientP *head=Players[0].skel.getSlot(8"head"); // obtain player "head" skeleton slot (this was created in Object Editor)
Cam.setPosDir(head.pos + finalOffset, head.dir, head.perp); // set camera from 'head' position, direction and perpendicular to direction
Also go into Interact, and replace the update with this:
Code:
void Interact::update()
{
clear();
if(Players.elms())
{
Player &player = Players[0];
if(!valid)
{
C OrientP *head=Players[0].skel.getSlot(8"head"); // obtain player "head" skeleton slot (this was created in Object Editor)
Vec dir = head.dir;
Vec pos = head.pos + (dir * 0.5f);
PhysHit hit;
if(Physics.ray(pos, dir*10, &hit))
{
valid = true;
obj = hit.obj;
pos = hit.plane.pos;
// Set the mesh to be highlighted
highlight = true;
// Clicked on the object
if(Ms.bp(0))
{
if(ButtonObject *temp = CAST(ButtonObject, hit.obj)) temp.Activate();
else if(Item *temp = CAST( Item, hit.obj)) temp.PickedUp();
Ms.eat(0); // Eat the mouse operation (this mouse click does not count for anything else in the project)
}
}
}
}
}
You don't have to bother with the drawPrepare for now.. Eventually, you will want to do it to hide the face while in FPP, but for now, it'll work fine (To use it, you have to assign body groups to your player character. My project doesn't have that set up, the tutorial does for the Warrior character).
Also, I'm preparing yet another update where you can toggle the camera between first person, third person, or looking at things with an event. So, the code I just gave you is temporary (but works fine for just first person only)