When I simply move the arm as it shows there, it moves horizontal, I simply rotated it and I took it from my file, and I just wanted to try it in a new file where many objects are already setup.
How do I correct it to animated forward and not horizontally.
If the original Animation is correct and you want the whole thing to be rotated or at another place then you have to parent it to eg. an empty and rotate and move the empty as you want.
But perhaps I didn’t understand your problem at all.
I did try using some code from that example file, Aihealth2, I had it configured from the demo that was from the FPS tutorial series, due to some effects I wanted to work as they were.
I tried too many times with my existing file, so I gave up on that.
I would like to get the mouse button to create a hit or I used this example, I tried using the code on the object, but that doesn’t work.
So what can I do to get this working.
What is the bknife, is that an empty for the object/weapon?
With that alone, the Ai just collides with the player and the health counter goes down
I couldn’t quite understand where that was from, it is the names on the bricks tied into this code from the example file.
I thought I’d use it as, the other example before was an instant effect, so it didn’t work to use a gun shoot.
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
health = own['health']
#knife
bknife = cont.sensors['bknife']
#bullet hit
bodyhit = cont.sensors['bodyhit']
#death states
bodydeath = cont.actuators['State3']
#knife states
if bknife.positive and health > 1:
own['health'] -= 1
if bknife.positive and health == 1:
cont.activate(bodydeath)
own.suspendDynamics(True)
#bodyshot
if bodyhit.positive and health > 1:
own['health'] -= 1
if bodyhit.positive and health == 1:
cont.activate(bodydeath)
own.suspendDynamics(True)