Game Development Community

Fix for camera movement when player is mounted in vehicle

by Kenneth Eves · in Torque Game Engine Advanced · 09/22/2012 (6:10 pm) · 0 replies

I was having an issue where high speed in a vehicle produced a rendering problem. Even at high FPS, the terrain rendering lagged a few ms and then jumped to into position. The effect looked like the terrain was being rendered at a lower frame rate than expected.

The issue turned out to be camera transform client-side when mounted.

I found this thread in T3D talking about vehicles and cameras: http://www.garagegames.com/community/forums/viewthread/120679 In post #8 there's a change to torquescript that I found resolved the stuttering.

player.cs Armor::onMount()

//resolves terrain stuttering
%obj.client.setControlObject(%vehicle);
//%obj.setControlObject(%vehicle);

Camera is now silky smooth.