apetavern / grubs

A worms-inspired artillery game for s&box with randomly generated levels.
MIT License
31 stars 7 forks source link

Rockets phase through grubs on direct hits. #312

Closed dch-GH closed 12 months ago

dch-GH commented 1 year ago

Usually when its at full charge.

trundlr commented 1 year ago

I'm curious if this is due to how we are Lerping along segments for the gadget's position.

Gadget.Position = Vector3.Lerp( currentSegment.StartPos, currentSegment.EndPos, _alpha );

It's possible the position is simply skipping over the grub entirely.

matekdev commented 12 months ago

This is because the rocket does not come out of the gun with a Y value of 0. Therefore the rocket passes the side of the grub. The only issue is that setting the rocket to have a Y position of 0 makes it look like the rocket didn't come out of the bazooka muzzle.

matekdev commented 12 months ago

https://github.com/apetavern/sbox-grubs/commit/d5714dd94e8611beb8a116474e8888077860aec4