I am looking at your game I found a few problems. But for now we will just focus on your question.
What I did notice was that when you "fire" your pistol the bullet only sometimes fires and
it never re-spawns.
This code isnt right., for one isCollisionBetween by default assumes there is going to be a collision event, and by using "not" your reverting its expected result.
if not isCollisionBetween(player, bullet1) then
if bcoll > 0 then
deactivate(bullet1)
playSound(reload)
end
end
You would write it like this:
if isCollisionBetween(player, bullet1) then
print("You shot the sherif")
else
print("Crap you missed and he is mad!! RUN!!!")
end
You can give your bullet a "follow" behavor the settings I used was
delay 0.00
x: 0.12
y: 0.55
z: 0.44
local: Enabled
With those settings the bullet moved and rotated properly with the character. I was able to walk up to the bridge and shoot one of the houses.
Lastly I would create a new scene to test in "A simple shooting range" with
1. A "plane" for ground
2. Your character
3. The bullet
4. A Target "Cube"
Once your shooting action is working right then bring that code into your main scene.
I have a question for you did you do the "walk cycle animation" your self or was that something you found somewheres?