I want to create a saw hazard for my current game and I want the arm to move back in forth similar to capturing the output of a sine function like this `movementDistance * Mathf.Sin(counter * movementSpeed);`
except I want the "edges" of the sine function to be capped off (compressed) like this ![alt text][1]
[1]: /storage/temp/180089-clippedsine.png
(original source: https://www.youtube.com/watch?v=yj53Q-pisbw&t=87s&ab_channel=CSGuitars between 0:48 and 0:57)
I'm aware I could simply use `Mathf.Clamp(calculatedValue, -extent, extent)` , but this would create drastic stopping and starting at the edges and I'd like to round these edges if possible to make a more realistic slowdown effect for the saw arm. How could I achieve such an effect?
↧