Raycast2D collision issues
Asked Answered
D

6

0

I'm using a Raycast2D node to get which tile in a tilemap it's colliding with, but it doesn't detect its Atlas_coords when it's facing to the left or up.
Any ideas?

Deflower answered 22/2 at 22:7 Comment(0)
B
0

Deflower got any code? maybe something in there?

Bide answered 23/2 at 20:11 Comment(0)
D
0

Bide
Player code and the Head code

Deflower answered 23/2 at 20:16 Comment(0)
B
0

Deflower by chance, did you check if your raycast is rotating when the player moves? I noticed in the head you are flipping scale to rotate the raycast? Doesn't this just make the raycast flip like a graphic? EDIT: I just noticed this had ### before it, so either it didn't work or maybe you forgot about these?

Bide answered 23/2 at 20:49 Comment(0)
D
0

Bide It does rotate the scale.x = -5 is to flip the sprite when the mouse is over to the left. the Raycast2D does rotate with it and i tried to use it without the scale.x but the same thing happened

Deflower answered 24/2 at 9:15 Comment(0)
B
0

Deflower odd. I am still learning raycasts myself. Have you tried perhaps using areas on all sides of the player and then rotating said object as needed? It's more work but might be worth a go.... Just Github back it up first. 😎

Bide answered 24/2 at 17:41 Comment(0)
D
0

Bide Have you tried perhaps using areas on all sides of the player and then rotating said object as needed?

I don’t understand what you are trying to suggest but just to clarify i’m using the raycast2d to mine (remove) a tile from a tile map.

Deflower answered 25/2 at 9:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.