Hey guys, im a long time lurker on these forums and thought if dive in for a first post :). Im currently attempting some kind of offline rpg type (i expect more tech demo then full game) with a WoW-esque targetting system. This is my first attempt at python so i do apologise for the appauling mess ive made of it. so far i have got it working so if you mouse over + click an object with the property “enemy” it selects the object (the empty named Target has a property named Target wich shows the name of currently selected object if you debug the property).
Where im hitting trouble is trying to make it so if you press spacebar, it takes 10 damage (HP property on all “enemy” objects) off the currently selected object, and also so that it requires a seperate press for each minus of health (ie, you cant hold down space and it ticks down the health continuously).
The target.py script is scratch written by me from tutorials etc so as i said, its messy, nasty, and probably full of bad practice, but if anyone could give me a hand with this, id be most greatful.
Targetting test.blend (283 KB)
Ive included a .Blend (if the attachment thing worked). to test what ive done, simply press P and click on the different objects on screen. you should see the name of the object appear in the debug property and for unknown reasons, the current objects health going down.