I have two issues with the camera system in my game...minor but very annoying.
First: Collision
Every time I update the camera, I position a pivot (CamPoint) at the location of the player, after turning off it's collision state. Then I re-enable collision for it (it has it's own type that only collides with the world), and move it up and behind the player. Then I position the camera at it's location.
The problem is, the collision never works. I thought it might be related to enabling/disabling the collision detection, but leaving it on all the time doesn't solve the problem. This is the only time I've ever had a problem with Blitz collisions failing to work at all. Anyone have an idea why?
Second: Rotation
To orient the camera smoothly, I use this method:
If EntityYaw(Player) > EntityYaw(CamPoint) + 1 Then
TurnEntity(CamPoint,0,1,0)
ElseIf EntityYaw(Player) < EntityYaw(CamPoint) -1 Then
TurnEntity(CamPoint,0,-1,0)
End If
The + 1 and - 1 are to keep the camera from getting "stuck" between two values, which results in seriously blurred scenes. My only problem is, sometimes the camera "flips" direction and takes the long way around, if the player turns really far before the camera catches up. Anyone know how I could fix this?
First: Collision
Every time I update the camera, I position a pivot (CamPoint) at the location of the player, after turning off it's collision state. Then I re-enable collision for it (it has it's own type that only collides with the world), and move it up and behind the player. Then I position the camera at it's location.
The problem is, the collision never works. I thought it might be related to enabling/disabling the collision detection, but leaving it on all the time doesn't solve the problem. This is the only time I've ever had a problem with Blitz collisions failing to work at all. Anyone have an idea why?
Second: Rotation
To orient the camera smoothly, I use this method:
If EntityYaw(Player) > EntityYaw(CamPoint) + 1 Then
TurnEntity(CamPoint,0,1,0)
ElseIf EntityYaw(Player) < EntityYaw(CamPoint) -1 Then
TurnEntity(CamPoint,0,-1,0)
End If
The + 1 and - 1 are to keep the camera from getting "stuck" between two values, which results in seriously blurred scenes. My only problem is, sometimes the camera "flips" direction and takes the long way around, if the player turns really far before the camera catches up. Anyone know how I could fix this?