DrBibop / RaftVR

A virtual reality mod for Raft
https://www.raftmodding.com/mods/raftvr
GNU Affero General Public License v3.0
8 stars 2 forks source link

feat: Improve Axe and Weapon Immersion #2

Closed danger7789 closed 1 year ago

danger7789 commented 1 year ago

Adjusted the collision checking to require the user to swing their axe for tree chopping and stab/swing their weapon when attacking.

ie. you can no longer place your Axe in a tree and hold it there for multiple chops, or place Spear in the shark and hold it there for multiple attacks, you must pull the Axe/Weapon out and re-hit for a second action.

DrBibop commented 1 year ago

It was implemented like this in beta Patreon builds before, but it has a pretty annoying drawback which made me opt for OnCollisionStay instead. Using OnCollisionEnter doesn't mesh well with cooldowns. Players would swing the axe, trigger the first hit, then try to swing again a bit too soon while the cooldown was still up and the hit wouldn't register until they removed the axe from the tree and hit again.

With OnCollisionStay, it would trigger the hit a bit later because of the cooldown but at least it doesn't seem like the swing was ineffective. In order to implement a proper "require to swing" feature, there's more work to be done than just changing it to OnCollisionEnter.