problem 1: aim-action don’t work, holding the right mouse button the character must aim up down When the gun comes out and stop aiming when the gun back. problem 2: he keep aiming!.
Thank you in advance for the help.
Set:
AimUpDown (ArmatureAction) Priority = 1
act4 (aim-action) Layer= 1
thanks for your quick reply!.
I already tried. the problem is my character can not aim and walk or jump and more action will stopped!. I think changed the script will solve the problem but I’m a beginner in script, I do not know where I start!.
the script :
import bge
GameLogic = bge.logic
from Rasterizer import *
cont = GameLogic.getCurrentController()
obj = cont.owner
Aim = cont.sensors[“sAim”]
MouseMove = cont.sensors[“sMouseMove”]
Sensitivity = 0.09
CenterY = getWindowHeight()//2
CenterX = getWindowWidth()//2
if Aim.positive:
YPosition = MouseMove.position[1]
xRot = (CenterY - YPosition)*Sensitivity
obj[“AimUpDown”] -= xRot
if obj[“AimUpDown”] < -40:
obj[“AimUpDown”] = -40
if obj[“AimUpDown”] > 40:
obj[“AimUpDown”] = 40
setMousePosition(CenterX,CenterY)
cont.activate(“AimUpDown”)
Try to use code tags when posing code (use
to start, and [ / code] to end, without the extra spaces) this preserves spacing.
Sorry, I can't help with the question.
I’m starting to lose hope!.
In the script the action actuator will not be deactivated. This is only a little fault and don’t cause the problems with the animations.
The animations are working in Blender 2.49b up to Blender 2.59.
These problems are caused by the new actuator (since Blender 2.60). This new action actuator has a new feature where you can mix animations and reverse playing animation. But at the moment the actuator is very buggy.
Stay Priority = 4, Layer = 0
walck Priority = 3, Layer = 2
walck Priority = 3, Layer = 2, start 40.0, end 1.0
run Priority = 2, Layer = 2
aim-action Priority = 0, Layer = 1
ArmatureAction Priority = 1, Layer = 0
With this setup the most animations are working, but you can’t walk or run and aim at the same time. Because mixing the arm channels (bones) from the four animations (walck, run, aim-action, ArmatureAction) is not working.
If you want to aim and run, you must make for the arm two or three animations.
Little example:
If you are waking you play the walk animation and the walking arm animation.
If you are walking and aiming you play the walk animation and the walk aiming arm animation.
import bge
GameLogic = bge.logic
from Rasterizer import *
cont = GameLogic.getCurrentController()
obj = cont.owner
Aim = cont.sensors["sAim"]
MouseMove = cont.sensors["sMouseMove"]
Sensitivity = 0.09
CenterY = getWindowHeight()//2
CenterX = getWindowWidth()//2
if Aim.positive:
YPosition = MouseMove.position[1]
xRot = (CenterY - YPosition)*Sensitivity
obj["AimUpDown"] -= xRot
if obj["AimUpDown"] < -40:
obj["AimUpDown"] = -40
if obj["AimUpDown"] > 40:
obj["AimUpDown"] = 40
setMousePosition(CenterX,CenterY)
cont.activate("AimUpDown")
else:
cont.deactivate("AimUpDown")
Thank you@Monster! for spending some of your precious time to help me!.