I want a target (image) showing up on enemies which i look at.
Problem with current solution: The mouse over actuator doesn’t work very well past 10 units distance between the player/camera and the enemy (especially from the top).
I was wondering if there was any other way to do this so that it would also work for long distances?
Just from thinking about it messages won’t work as they will trigger the image on all enemies at once.
Maybe you confuse it with “drawLine” which is an attribute of module bge.render.
Function names have no relation to script mode or module mode. The only relation is that you need the function name when configuring the Python controller in module mode.
As I do not really know what Thatimster is going to do I suggest to call the combination of drawn line + addedObject a “laser” which gives “drawLaser” a meaning. Thatimster can call it as he like. Even “performTheMikeyMouseDance” would be sufficient (beside the fact it is obviously not correct). To be honest it would have more value than “main”. Unfortunately I do not know what a “main” is in the context of the BGE.
if sens.positive and (2nd input).positive:
cont.activate ['State']
caused a subscript error in the console using both module and script mode.
Just to be clear i’m not actually using the drawline function in game.
As irrelevant as the name “main” might be, it has nothing to do with the problem at hand (no offence intended), so instead of turning into a big rant like every 2nd thread on BA can we please focus on the topic at hand. I would appreciate it:D.
From my understanding when the players ray hits an enemy it spawns an object (on the enemy). I want to then change the state (on the player) which then goes to an attack state.
Any little snippets of code which i could substitute in or explanations on why its not working and how i can fix it would be greatly appreciate it:D!