Topic was automatically imported from the old Question2Answer platform.
Asked By
RoniPerson
I have an enemy casting a ray towards the player to check if it can see the player.
In my tilemap there is an tile with oneway collision but the raycast dont respect oneway collisions. Is there a feature for raycasting with oneway collision?
I am using the intersect_ray function not the raycast node.
While I’ve never used intersect_ray(), the docs mention a number of ways that objects can be ignored by the raycast. I’d assume one of them can be made to work for your case…
Additionally, the method can take an exclude array of objects or RIDs that are to be excluded from collisions, a collision_mask bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with PhysicsBodys or Areas, respectively.
I’m not aware of any way to specifically ignore one-way collisions using intersect_ray()