4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.

Home Page:https://gdevelop.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raycast collision bug,skipping first collision iteration

RMDB-GD opened this issue · comments

Is there an existing issue for this?

Describe the bug

Hey there mind to try to test this:

https://mega.nz/file/cYkRXBAT#xHa3jfcb7-kPSc6qOGcIDN4NpZPb2sJe9-YkpTY8ruk

What i noticed is that the first collision iteration of raycast (even if not in collision) is always positive while it should not.
It means that every condition to check if player is hit before getting close is always positive…and at the enemy creation they will see u anyway no matter what (or obstacles). (Like getting hit from behind a wall in Dark Souls :))
Asking if possible for a fix…simply becouse at an enemy creation, if laser is not hitting something, collision should not happen.
Anyway i’m asking you opinion on the matter.
I may be wrong but i remember this to works in v 5.2
Thx in advance

operation:
start the game player is hit but laser is not hitting.

you can drag black box with mouse to check collisions

u may need to get enough close to check later collisions cos i’ve volountairly reduced the lenght

EDIT: also later collisions are bad calculated, because they should not happen above laser lenght.
In the end i guess raycast collisions needs a total rework

A possible fix would be to cast the laser at declared lenght and fix the first collision

GDevelop platform

Desktop

GDevelop version

latest

Platform info

OS (e.g. Windows, Linux, macOS, Android, iOS)

OS Version (e.g. Windows 10, macOS 10.15)

Browser(For Web) (e.g. Chrome, Firefox, Safari)

Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)

Additional context

No response

You can close this, raycast is working.
i just misinterpreted it