Raycast in 2d scene (SOLVED)

I want to get collision point to a static collisionobject and i used raycast that slice that collisionobject but the result is always nil.
is there anything that i missed completely?

i showd the collisionobject go and draw raycast in this image.

image

1 Like

Did you assign it a group and include that group in the raycast call?

yes i did

Compare your setup with the raycast example: https://defold.com/examples/physics/raycast

1 Like

Now i see the problem
i was creating raycast in init function and well it returns nil, moving it to update it’s working now.