The FPS camera doesn't want to move for me... I can make it look around with the mouse, but the arrow keys won't move it. I didn't realize this was wrong until after i started taking the collisions and it mentioned being able to move in tutorial 2.
I've compared my code with the example and swapped lines a little bit, but it looks (to me) to be the same and I'm not sure what i'm doing wrong. I named the camera node "camera" and i highlight the word camera as yellow in my source code so hopefully it will be easier for someone to tell me what i'm doing. Thanks so much.
http://patrickavella.com/help.html
Newbie Help with addSceneCameraNodeFPS.
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
You've got an error on line 26
You put the && right next to the end of EVENT. Also, it should be !event.KeyInput.PressedDown, but I don't understand why you're trying to create a flyCircleAnimator with the FPSCamera? And why are you returning the camera twice?
Code: Select all
if (pc!=0 && event.EventType == EET_KEY_INPUT_EVENT&&
event.KeyInput.PressedDown) {
the second camera return is commented out left over from another tutorial, and the variable "rotate" is getting reused (it's named "anim" in the tutorial), i drop it and reset it after I init each node.
I fixed the error in my code, but i still can't move the camera with my arrow keys.. hmmmm
The tutorial compiles and works fine, but i've gone and messed something up I'm sure it will end up being something simple but i'm just not seeing it
I fixed the error in my code, but i still can't move the camera with my arrow keys.. hmmmm
The tutorial compiles and works fine, but i've gone and messed something up I'm sure it will end up being something simple but i'm just not seeing it
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
Maybe you don't need that ! after all... I've been looking to change the keys to WSAD also but I haven't got around to it yet so I'm not exactly sure how to tell you to do it. But you say the arrow keys won't work? All you need for an event receiver class that uses the arrows is this:
That'll move you around with the arrow keys...
Code: Select all
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (camera)
return camera->OnEvent(event);
return false;
}
};
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
get rid of theand see if it works then...
Code: Select all
camera->addAnimator(rotate);