Issues with Raycast

So Maybe you’ve seen one of my other pleads for help. But I decided to get rid of collisions due to their inabilty to overlap, and reaplced them with RAY CAST.

New issue though, I have projectiles that constantly raycast for an enemy 1/5 of the time they trigger the raycast, the other they don’t and go right past the enemy.

image

Just wondering if this is a known issue.

Side Note, Increasing the length, decreases the probability of it happening.

1 Like

It seems like it’s just not hitting, do the enemies come at different angles?

Can you put in the link of the game? I will look at it.

They all are on the exact same axis, the only thing that seems to cause it to miss semi-consistently, is when the enemy is mid animation/ moving. But that it happens either way, still or moving.

How different is the base sprite from the animation?

Well the enemies are split into body parts, but the original objects animation slightly moves it forward then back.

Do animations change the hitbox?

Animations don’t change the hitbox at all, so maybe it might look like the ray is hitting but it’s just because the animation is slightly different. Trying testing it with the animation turned off.

It still happens, So it’s not the animation, and it’s not the movement.
Maybe it’s just a bad frame drop issue?

It could be. I’m busy rn and will be for a while so I can’t check currently, but I can later.
Which object is the ray in?

1 Like

Its in the “projectile” object.
Fired from most of the plants.
No pressure really, you end up helping me a lot

1 Like

How often does this bug happen? Does it only happen when the zombies are right next to the plants?

1 Like

It happens at any distance. I mean I bet you’d see it happen by playing the first level.
But it seems truly random

So I’ve been experimenting, and this really does seem to happen when the enemies move.
If collisions worked better, then I’d think of a work around, but this is an impossible thing to replace I think, I’d have to see other peoples projectile examples.

I know spawning things via Emit improves collisons, idk if that helps

The issue with the collisions, is two things colliding at the same time, so not sure if that would change anything. Do you know of any games people have made with lots of projectiles?

Not really. ASTRONN by pixelpizza has a lot, but other than that I haven’t played many games

Im having a problem as well i can not find the raycast at all what do i do