Can't move camera (WASD keys don't work.)
by Steve Lamperti · in Torque 3D Professional · 12/13/2011 (3:10 pm) · 9 replies
My project doesn't have a player. It has a free flying camera. Recently (After updating to 1.2), I am having a problem whenever I try to move the camera with either the WASD keys, or the mouse for rotation. What happens is that the camera image flickers as if the camera was trying to move, and then returns to the initial position.
I don't think that what returns the Camera to the initial position is any of my code, but I am having a really hard time figuring out what it is, or even how to debug it.
I did debug the keystrokes and mouse moves that I am inputting, and they seem to being processed correctly, but afterwards, the camera just always moves back to it's initial position.
One weird thing about this, it seems to happen only some times when I open the project. about half the time the camera works fine, the other half of the time, it does this locked thing. I've compared the console for working and not working cases, and cannot see anything in the console that looks like it explains the difference.
If anyone has any ideas as to what may be happening, or any suggestions as to how to debug this, I would really appreciate any help.
-Steve Lamperti
-Imagine That, Inc.
I don't think that what returns the Camera to the initial position is any of my code, but I am having a really hard time figuring out what it is, or even how to debug it.
I did debug the keystrokes and mouse moves that I am inputting, and they seem to being processed correctly, but afterwards, the camera just always moves back to it's initial position.
One weird thing about this, it seems to happen only some times when I open the project. about half the time the camera works fine, the other half of the time, it does this locked thing. I've compared the console for working and not working cases, and cannot see anything in the console that looks like it explains the difference.
If anyone has any ideas as to what may be happening, or any suggestions as to how to debug this, I would really appreciate any help.
-Steve Lamperti
-Imagine That, Inc.
#2
12/14/2011 (10:19 am)
My project is actually single user. I am sure you are right about what is happening, I had kind of reached the same conclusion myself, but I am not sure why the motion from my key and mouse commands doesn't get to the server in the first place.
#3
12/14/2011 (10:22 am)
Actually, I am very sure you are right about what is happening. When I traced the behavior I was seeing repeated packets of information from the server to the client with move information. I'm just not sure why I keep getting info from the server even without any input, and also why my first position/rotation changes don't get to the server.
#4
After spawning the camera try and give it a mode.
12/14/2011 (1:42 pm)
Just to check ... but what mode are you spawning the camera in? If it's a stationary cam then it's ... gonna be stationary.After spawning the camera try and give it a mode.
#5
Note that you might be looking for Overhead mode instead of OrbitObject mode. This page discusses the various camera modes available.
12/14/2011 (3:36 pm)
Try Steve's camera stuff from here and see if it doesn't get you moving in the right direction. I'm working on getting the RTS Prototype documents back up and working, but hopefully his information will help you get up and running.Note that you might be looking for Overhead mode instead of OrbitObject mode. This page discusses the various camera modes available.
#6
12/14/2011 (4:12 pm)
Something that may have been missed in the last few responses. It's working great about half the time. I hadn't seen a pattern to when it works right and when it doesn't, but now I think I may have. Something else came up that I have to look at more urgently, but I think that the pattern as to when the camera is locked, and when it is moving and working just fine has something to do with whether or not I click on a window while the mission file is loading. (And/or which window is the active one, haven't really finally nailed it down yet.) I will post here when I have the exact pattern as to what causes it to fail, but it may be some kind of window focus issue.
#7
If anyone has any idea as to what state I am getting into that locks the position of the camera, I would appreciate suggestions. (I will check into the stationary camera suggestion.)
12/15/2011 (1:58 pm)
This is definitely something specific to my project. It absolutely works when I click on the window while it's loading the mission, and fails if I don't touch it. The break is probably something in my code, as I am replacing the window that contains the engine with my own window.If anyone has any idea as to what state I am getting into that locks the position of the camera, I would appreciate suggestions. (I will check into the stationary camera suggestion.)
#8
Thanks that seems to have done it. Setting the mode to 'Fly' explicitly seems to have fixed the problem. Just a speculation on my part, but perhaps the camera mode is not initialized properly, and if it's not set explicitly it's coming up differently in different situations? Not sure otherwise why clicking on the window during launch changed the camera mode.
Anyways, it seems to be fixed. Thanks for the responses.
12/15/2011 (2:39 pm)
@Steve,Thanks that seems to have done it. Setting the mode to 'Fly' explicitly seems to have fixed the problem. Just a speculation on my part, but perhaps the camera mode is not initialized properly, and if it's not set explicitly it's coming up differently in different situations? Not sure otherwise why clicking on the window during launch changed the camera mode.
Anyways, it seems to be fixed. Thanks for the responses.
#9
12/16/2011 (4:59 pm)
Turns out that that didn't fix it. It's still showing up sometimes. In fact, my pattern is gone as well. It's not just about when I click on the window. I guess I'll be banging my head against this one more on Monday.
Torque Owner Richard Ranft
Roostertail Games