Here is my code:
import bge from bge import logic def property(controller): own = controller.owner controllor = bge.logic.getCurrentController() scene = bge.logic.getCurrentScene() target = scene.objects['Target'] ray = controllor.sensors['Ray'] if (ray.hitObject and 'Collide' in ray.hitObject and not 'Body' in ray.hitObject): target.worldPosition = ray.hitPosition elif (ray.hitObject and 'Collide' in ray.hitObject and 'Body' in ray.hitObject): target.worldPosition = ray.hitPosition own['Body_Track'] = True
I have not finished with my code, but that is what I made so far. I am trying to make different props true and false depending on what you are aiming at: an object, and enemy (, rest WIP). This is to determine what color bullethole/blood should be added. For some reason, the last line of the code won't work. I always have issues with making multiple outcomes after an if. How can I fix this? Any help is appreciated. Thanks!