BGE - How to get Joystick Input/Angle Change?

Hey guys,

I’ve started throwing together a small example earlier on today with “fixed” camera angles, like in some cool old horror games. Basically, the character always moves according to the active scene camera (with one exception, explained below). Collision boxes activate the camera areas. That works like a dream. What I’ve now been trying to implement into it is the following:

Character movements should only change if:

camera has been changed AND Joystick input is changed (Released, or Axis Changed)(so, if there has been a joystick input since you entered the new area, even if the slightest change in the axis, THEN I want to execute the new controls script that work for the appropriate cameras.

Concept: If the player is running forward and there’s a camera change, they won’t have to quickly turn the pad, they’d just have to hold the exact same direction they were going before the cam change, and the movement will carry on just forward. This way you can run down a long hallway with 200 camera changes but u only have to press and hold forward once :slight_smile: Because you’re not changing the axis when you enter the new areas, so it’ll just run forward.

Here’s a blend file of my progress:


I’m pretty proud of it as a beginner myself, and It’s now kinda doing what I want - only activate new directions when new joystick input received(release) - but as you will see if you’ve downloaded, I’ve tried a workaround (quite a few versions on) and now, if I get into a new cam-area, and let go of joystick then it will reassign the controls to the active camera. But I don’t want to have to let go of it, I just want it to change when a new input is received. That includes Release AND Axis Change.

The Joystick sensor has been tried in mny ways to do this but I’m sure it’s gonna be something python… which is good I’m kinda getting into it now, seriously…

Anyways, if there’s anyone out there to care to help me out I’d be chuffed for life as it’s something I’ve been wanting to do since the original Silent Hill games! Would be a dream come true!

Also, if this is too confusing I’ll try and explain it better just let me know, and please have a look in the file, you might be able to help me! :slight_smile:

Thanks everyone for looking!

  • Pete

nice blend thanks for sharing. this reminds me of resident evil and dino crisis.

Thanks! I’m close to solving it as well, I’ve got the control-axis update when I change the Joystick axis in a new camera angle, or release it an move again. Just gotta tell blender by how much change should it respond :slight_smile: - and sort out the “track to” actuators because they seem to do weird rotations even though 3D mode is off…

Also, I have sorted out the rotation of the control - angles - now they only copy the active camera’s Z rotation, so frwrd/back/left/right are always above ground at a steady position on the Z axis.

But yeah. was thinking of implementing standard tank controls as well, like in resident evil - player would be able to toggle between control styles, but that’ll kinda be the easy part cause that’s just back and forth, and rotation left right on local axis, so… :slight_smile:

Once it’s finished and polished, documented, it will be ready to go template for dragging and dropping new areas/cam angles quickly and flexibly, as everything is relative, you can just duplicate the area-triggers with their camera assigned as many times as you want, without ever having to rename or reassign anything.

Replace Suzanne with, throw some nice looking environment and boom, got a little cinematic game to play around with :slight_smile:

This belongs more in the Game Engine Resources area, not General Discussion.

Apologies, - if a MODERATOR sees this - Please move it to the appropriate forum.

Btw I posted here cause I would have required a bit of help but I’m slowly but surely figuring it out by myself :stuck_out_tongue:

Thank you!