irei1as Posted May 13, 2015 Share Posted May 13, 2015 This TorqueScript code:function serverCmdorbitCam(%client) { %client.setFirstPerson(false); %client.setCameraObject(%client.camera); %client.setControlObject(%client.camera); //just in case %client.camera.setOrbitObject(%client.player, "0 0 " @ -mDegToRad(90), 15, 25, 25, false, "0 0 1", true); %client.setControlObject(%client.player); } fails setting the camera with the correct angle.While:function serverCmdorbitCam(%client) { %client.setFirstPerson(false); %client.setCameraObject(%client.camera); %client.setControlObject(%client.camera); //just in case %client.camera.setOrbitObject(%client.player, "0 0 " @ -mDegToRad(90), 15, 25, 25, false, "0 0 1", true); schedule(0, 0, commandToServer,'ctrlobj'); } function serverCmdctrlobj(%client) { %client.setControlObject(%client.player); } works correctly.(Note: usingcommandToServer('orbitCam');just before the closing "}" of GameConnection::onClientEnterGame(%this) inside game.cs)Well, can I change a non-player camera -OrbitObject this case- without having to rely on camera control? I guess I'm doing something wrong.Or, is it possible to make the camera change be instantaneous so I don't have to worry about the client losing the player control?If it's important: I'm using a very weak computer for this so if you tell me it works for you it may be just this low end machine. Sorry for the trouble. Quote Link to comment Share on other sites More sharing options...
rlranft Posted May 15, 2015 Share Posted May 15, 2015 Just a tip: Don't schedule anything for less than 32 ms. You will start getting random "no flux capacitor installed" asserts (except "not on my machine" because you are using a really slow computer - so "irritating crash that developer can't reproduce").And why not set the control object first? It all should happen within the span of a tick or two - no one should notice a 32ms tickle.... Quote Link to comment Share on other sites More sharing options...
irei1as Posted May 15, 2015 Author Share Posted May 15, 2015 Thanks for the tip. It's good to know.And the idea of setting the schedule first sounds quite sweet.Now I wonder if the error is related to http://forums.torque3d.org/viewtopic.php?t=12 . I'll have to check. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.