Update!
Changes have been pushed to GitHub and the Roblox Library.
Summary:
- Added
SoundSystem:Attach(SoundObj)
- Added support for
SoundService:SetListener()
- Cleaned up the math and actually fixed a couple issues with it
SoundSystem:Attach(SoundObj)
Suggested by @xXVernandoXx!
Until now, the module could only add the 3D effect to sounds it created from the :Create()
function. Now, if you have a Sound created some other way, be it by another script or before runtime, you can call :Attach()
on it to attach the module’s effect onto it as well.
SoundService:SetListener()
Suggested by @lArekan!
Prior to this update, the module assumed you use the default listener: the Camera. Now, it actually gets the Listener, therefore adding support for setting your listener to various objects or CFrames.
Math changes
Big thanks to @EgoMoose’s Dot Product video!
The previous version had some odd behaviours when you left the origin, due to an oversight on my part. Forgot to test while walking around
Fixed that now!
Also, changed the easing aspect to -(25 * ((Angle/pi)^2))
, which gives a nicer curve.