Raycast with 2 moving object

Can some body help me with raycast
Example like Player shoot the raycast to recoginze the enemy,box, …

I can ask engineering if they have an example. What version of Creator are you using?

version 2.4

You can try using Raycast by referring to this demo.It uses CocosCreator 2.4.6, which also works with CocosCreator 2.4.3.
example-physics.zip (723.9 KB)

this is not version 2.4.3

I revised my response.

Thanks you, but let me ask you that why my enemy only raycast himself
here my code


and also i set the positon my enemy and my player the same y and z, only different x