GothicVRProject / GothicVR

Fan project recreating the classic Gothic I and II experience in VR.
GNU General Public License v3.0
26 stars 2 forks source link

Change NPC FP/WP/ZS_* collision behaviour from Colliders to Vector3.Distance checks #350

Open JaXt0r opened 5 months ago

JaXt0r commented 5 months ago

Original G1 isn't leveraging Colliders, but checking the distance to an actual FreePoint/WayPoint/ZS_*. Sometimes NPCs spawn right next to it, which means a call like GotoFP() won't trigger a collision as the NPC is already "inside" the destination.

I currently set it up to check the distance at startup, but this feels wrong. Especially, as Collisions can be detected too early (e.g. if a hand is moving forward and triggers the collision (if using mesh collider only; Hint: not yet used) or the box collider is plainly triggering earlier than the original G1). This can lead to wrong locations where NPCs stand a few cm away from intended place.

Examples of spawned NPCs:

Guard (214) image

Gomez (100) image