I have the following code:
import bge
from bge import logic
controllor = bge.logic.getCurrentController()
scene = bge.logic.getCurrentScene()
target = scene.objects['Target']
ray = controllor.sensors['Ray']
if (ray.hitObject and not 'Fire_False' in ray.hitObject):
target.worldPosition = ray.hitPosition
This works fine wit all my weapons except melees. The reason for that is the following: bullet holes are added to the target, as that is where the bullet actually is. For melees, you can use a melee in a short range, as in, when you attack, you only attack close. I need to edit this script into where if it [target] is not colliding with anything, a property will be false. The property, if false, means that it [target] should be tracking to an object. How can I achieve this? Any help is appreciated. Thanks!
ALSO: For ease, I just need a prop to be false when not colliding.