Hey How are you guy/girl! :eyebrowlift::eyebrowlift:
My name is hiroshi, Im from argentina perhaps very badfor my englis, sorry ok!
My problem is the next community blender, in it No Spanish language experts in python bge:
I have a game with military model, a camera, an empty and collision (cube), Too se that I have the script next :
import bge
from bge import render
bge.render.showMouse(True)
cont = bge.logic.getCurrentController()
own = cont.owner
mov = cont.sensors[“mov”]
altura = (bge.render.getWindowHeight())
#largura = (bge.render.getWindowHeight())
own[“posY”] = altura/2- mov.position[1]
#own[“posX”] = largura/2- mov.position[0]
own[“u”] = -own[“posY”]/6.0
#own[“d”] = -own[“posY”]/8.0
#own[“l”] = own[“posX”]/21.0
#own[“r”] = -own[“posX”]/21.0
— OK GUYS THIS IT A SCRPIT PYTHON THAT FOUND WITH ANIMATION, animated look_up and look_down, it spine break
both it have constraits parent bone and armature model’s
This Right! Working nice! the soldier look up and down MOUSE LOOK but… I find a problem:
This Script is not compatible with mouseLook why, It cant look up and down, only Rotate Right and Left, the python script like the next code :
import bge
from bge import render
from math import radians
from mathutils import Matrix
g=bge.logic
scene = g.getCurrentScene()
co = g.getCurrentController()
o= co.owner
#sensor
mouse = co.sensors[“mousesensor”]
#objects
Cube= scene.objects[“player_one”]
cameraTarget= scene.objects[“cross_fire”]
#####mouse movement
movSpeed = 0.01
rotSpeed = (0.001, 0.001)
mouse look
x = (render.getWindowWidth() / 2 - mouse.position[0])
y = -(render.getWindowHeight() / 2 - mouse.position[1])
object rotation horizont.x
Cube.applyRotation((0 , 0, int(x) * rotSpeed[0]), False)
render.setMousePosition(int(render.getWindowWidth() / 2), int(render.getWindowHeight() / 2))
#cameraTarget.applyRotation((int(y) * #rotSpeed[1], 0, 0), True)
render.setMousePosition(int(render.getWindowHeig#ht()
#/ 2), int(render.getWindowSize() / 2))
------- ANY SOLUTION¿¿¿ For what I want it model action look up and down and rot camera vision but not found correct! :(
The render.setMousePosition ->>> render.getWindowWidth and render.getWindowHeight it has problems guys!
Help me u.u
Leave a Print:
My progress work and Reference