You need to use the AI Sensor action added to the enemy AI:
Action editor > Player Category > AI Sensor
i have just tested and it picks up objects that are inactive.
It was tested it in the scene you sent me before (matrix3).
> Set the AI Sensor action to work on Flags 1 & 7. (Note: 7 is a number i chose as it could be any number over 5 as long as the character is matched.)
> Set the characters to 0 & 7.
> Set the Crate to 0 & 1. (1 allows the crate to be pushed around.)
This will stop the Sensor from reacting to the ground or normal physics entities and will only return characters or objects you specify the flags with, which increases performance and makes less to go wrong.
> Set the AI Sensor Range Property to something like 5.
Be careful as scaling the character seems to scale the AI Sensor debug sphere. So set entity Scale to 1,1,1. Change radius to match distance and then scale it down.
> If you need a faster detection, then decrease the "Think Speed" value for faster update.
> Add this code into a microscript (external will work next release hopefully).
- Code: Select all
function onSensorContact_Enter(targetID)
sky.lprint("SENSOR :: Detected Target: "..targetID);
end
function onSensorContact_Stay(targetID)
sky.lprint("Target Staying: "..targetID);
end
function onSensorContact_Exit(targetID)
sky.lprint("Target Exited: "..targetID);
end
I did notice that your characters were not 1:1 scale ratio and are currently at "0.081". You should use the mesh editor to rescale these and then set them to 1,1,1. It could be why your characters have issues following navmesh.
You also have to use a "Microscript" with the AI Sensor, as it does not callback to an external script yet.
I will check this out today as it is part of my current job now
Hint: Remove the trigger body and use the AI Sensor instead. It returns better and is based on a timer so will be quicker for characters and AI.
If you need any more help, let us know and we will respond