As you know, I'm playing around with the FPS system (thanks for all your help so far ).
Unfortunately, I've come across an issue with the "onSensorContact" functions
When logging to the Console, I get the following (based on an AIS Bounds Radius of 10):
- Code: Select all
Orc1 - onSensorContact_Stay: 10
Orc1 - onSensorContact_Stay: 9
Orc1 - onSensorContact_Stay: 8
Orc1 - onSensorContact_Stay: 7
Orc1 - onSensorContact_Enter
Orc1 - onSensorContact_Stay: 6
Orc1 - onSensorContact_Exit
Orc1 - onSensorContact_Enter
Orc1 - onSensorContact_Stay: 7
Orc1 - onSensorContact_Stay: 8
Orc1 - onSensorContact_Stay: 9
Orc1 - onSensorContact_Stay: 10
For some reason, "Enter" doesn't get called until "Stay" has been called a few times, then "Exit" gets called almost straight away, then "Enter" gets called again??
Also, is it possible to access the AIS Bounds Radius through Script, as I would like to alter it based on which waypoint the character is heading towards?
Or, another option would be to have a larger part of the sensor Sphere in FRONT of the character, with a smaller part behind (to simulate being able to see further in front?, and hear a little of what is behind?)
Or, another option would be to limit the sensor Sphere to a half Sphere going from the character FORWARD, which would simulate forward vision, and then have another sensor Sphere to detect sounds?
I suppose this could all be done in code, by working out which direction the character is heading, and then ignore the sensor contact if the character is heading AWAY from the Player, unless the Player is close behind?? I'll see if I can do this, but I'm not sure my maths will be up to it!!
Regards
Shando