How do i use the raycast() method

Topics: User Forum
Feb 26, 2013 at 6:22 PM
I need to check if my enemies have a clear line of sight to the player, i know that i can do this using a raycast, however i have no idea how to use the built in method. I understand the last two parameters that go into the cast(the start and end points), however i have no idea what the raycast callback is or how to implement that parameter. I would like to set the cansee bool value to true and then tell the enemy to fire a bullet. Could someone point me to an easy example on how to do this/tutorial or if you could write an example. I have looked at the example supplied with farseer sample but i cant follow it since there appears to be so much more going on, i have not been able to find any tutorial or explanations either. Thanks in advance.
Mar 2, 2013 at 9:36 PM
You should try to download the TestBed project in which you would find some examples about raycasts