[UPBGE 0.3.0 ] - character camera relative motion control + FX asset "fireball"

import bge,math, mathutils


def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner
    forward_keypress = cont.sensors['W']
    camera = own.scene.active_camera
    rot = mathutils.Matrix.Rotation(math.radians(45), 3, camera.worldOrientation.col[0])
    Cam_plane = rot @ camera.worldOrientation
    
    if forward_keypress.positive:
        own.applyMovement(-Cam_plane.col[2]*.05,0)

main()

use mouse + W key at the moment to test the demo
camera_plane_motion_dynamic.blend (726.7 KB)

camera_plane_motion.blend (724.0 KB)

1 Like