0 votes

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.

in Engine by (300 points)

1 Answer

0 votes

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()

Docs are here:


by (10,928 points)

The problem is that in all cases the "object" is the tilemap. But i only want my oneway tile to be ignored and i only have one tilemap.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.