Well this is part 4 of my blender tutorial on how to make an advanced fps game. Enjoy and im sorry about the lagg.
get python here:http://www.python.org/download/releases/2.6.2/
script:
######################################## ##############
#
# MouseLook.py Blender 2.45
#
# Clark R Thames
# Released under Creative Commons Attribution License
#
# Tutorial for using MouseLook.py can be found at
#
# www.tutorialsforblender3D.com
#
######################################## ##############
########################### Logic Bricks
# Get controller
controller = GameLogic.getCurrentController()
# Get sensor named Mouse
mouse = controller.getSensor("Mouse")
# Get the actuators
rotLeftRight = controller.getActuator("LookLeftRight")
rotUpDown = controller.getActuator("LookUpDown")
############################## Need the size of the game window
import Rasterizer
width = Rasterizer.getWindowWidth()
height = Rasterizer.getWindowHeight()
############################### Get the mouse movement
def mouseMove(): # distance moved from screen center x = width/2 - mouse.getXPosition() y = height/2 - mouse.getYPosition() # intialize mouse so it doesn't jerk first time if hasattr(GameLogic, 'init') == False: x = 0 y = 0 GameLogic.init = True return (x, y)
pos = mouseMove()
######## Figure out how much to rotate camera and player ########
# Mouse sensitivity
sensitivity = 0.0020
# Amount, direction and sensitivity
leftRight = pos[0] * sensitivity
upDown = pos[1] * sensitivity
# invert upDown
upDown = -upDown
######### Use actuators to rotate camera and player #############
# Set the rotation values
rotLeftRight.setDRot( 0.0, 0.0, leftRight, False)
rotUpDown.setDRot( upDown, 0.0, 0.0, True)
# Use them
GameLogic.addActiveActuator(rotLeftRight , True)
GameLogic.addActiveActuator(rotUpDown, True)
############# Center mouse pointer in game window ###############
i looked at all this shit and it didnt work.
DEADDUCKGAMES 1 year ago
@DEADDUCKGAMES There will be an update soon that will work... sorry for the inconvenience...
kiychane01 1 year ago
TIP:
on ur desktop to make icons smaller in vista CTRL+mouse wheel
hope it helps
rokyfox 1 year ago
@rokyfox yes it did, thank you soooo much
kiychane01 1 year ago
Shaders not supported!
Python error compiling script - controller " cont#CONT#1":
File "Freelook", line 51
pos = mouseMove()
----^
(Those 4 dashes aren't there, I'm just not sure if youtube can format comments properly) Does anyone know what this means?
cojaca3 2 years ago
the script is missing some enters and some tabs so it dont work
kiychane01 2 years ago