Hi guys,
the last days I tried to fix a weird camera problem, which occurs during movement of a controller.
I just want to make the camera follow the controller.
So the fist thing I tried was to use the
.at function to set the position the camera should look at to the position of my controller.
Cam.at=controller.center();
As soon as the controller moves (which is moved with
controller.update(vector,0,0); function) there is a displacement between relative position of camera and controller.
(white shape is in static situation, green during movement to the right side)
I also tried to use the position of the actor but it doesn't change anything.
By trying to use the
.setSpherical(); function, it doesn't happen anything until i set
CamHandle(0.1f, 10,NULL);
which confuses me a lot, because it it doesnt have to be set in "16 - Camera Modes.cpp" of the tutorial scripts.
Does anyone has any idea what my problem is?
Thank you for your help in advance
Fab
[thread can be closed]
I tired the only logical thing and it worked. It is a little embarrassing that I found it out by myself five minutes after posting this.
For people who have the same problem in future or are just interested in the solution:
Next to the current position of the actor you want to position the camera at, you have to add a small distance which is in relationship to the velocity of the actor.
So "
+controller.actor.vel()*Time.D()" describes the kinematic relationship of this displacement and must be added to the position.