Hi, I’m trying to make my own spring module for fun. When I finally thought I got it working it decides not to work properly with only rotations(It seems to work on lower starting speeds). If I’m using it with size and position it works fine. Could the formula be the problem or am I hitting something like a gimbal lock?
Code:
mass = 1
dampening = 0.025
tension = 0.025
speed = Vector3.new()
local displacement = goal - instance.Position -- instance is the part
spring.speed += ((tension/mass) * displacement) - (dampening * speed)
instance.Position += speed
These are both given a starting speed of 5 in the x and z axis and a 50 in the y axis
Sorry for low quality I used the roblox recorder
Spring with rotation(it seems to never stop):
Spring with position: