If the motor6d is moving constantly you will have to loop it to update the new length of the desired side.
What is the desired side your trying to get. The opposite or hypotneus?
Can’t quite understand what you mean.
I’m not the best at this language considering it’s my third language, but I’ll try to send an example of what I mean. https://gyazo.com/513e9bb84515171a370b9a3748a894be
Do you mean what way I’m trying to make it sine?
You could get the sine of tick() and multiply the amplitude by the desired angle, put it in absolute value if you want it to range from 0 to 45, and not from -45 to 45.
math.abs(math.sin(tick()) * math.pi / 4) -- // Mentioning that pi / 4 is equivalent to 45 degrees, but just in Radians.
Please state clearly why your using sin and what value you’re trying to achieve with it. An angle, or a side length to achieve that angle.
math.sin is used for getting a side length using a side, and angle. Or a angle being two triangle sides. Using the two sides.
What are you trying to achieve. The new length to make the motor 6d move at the angle.
and math.sin(math.rad(angle)) doesn’t change. It is constant as long as the angle stays the same. All you have to loop is getting the new length of the side your trying to desire. Unless the motor6d isn’t moving and is fixed, than you only have to do it once.
local sinAngle=math.sin(math.rad(angle))
----loop here
local hypotneus=opposite/sinAngle
local opposite = sinAngle*hypotneus
-----
Considering this answer, I don’t think he wants to use Sine to find a side, but rather to use it’s Functions to loop a number constantly from -amplitude to amplitude.
For example, If i am at math.rad(90) on a Tilt Motor6D, I want it to go in a smoother way to the radian 45.
Consider this as another “clue” of what I mean.
This video shows that he uses math.sin() to go to a specific radian, just not looped, and I do not want it to be looped.
To state again, I don’t want a looped math.sin() that goes from one to another, only to one angle and that was it, it does not move after going to that angle.
Please consider asking me to explain again, if you don’t understand what I mean.
You are not wrong about that, in cases where you have to start the effect at a certain point, it is necessary. If the effect is running constantly in the background, then there is no need for a Start Tick. But technically, you aren’t wrong.
If you attempting to change the angle of it, and not change it’s position. Couldnt you just change the Motor6D rotation and tween it, for a smooth change.
local TweenService = game:GetService("TweenService")
local TweenCFrame = CFrame.new(Motor6D.C0.Positon) * CFrame.fromEulerAnglesXYZ(math.rad(desiredXangle),math.rad(desiredYangle),math.rad(desiredYangle))
local Tween = TweenService:Create(
Motor6D.C0,
TweenInfo.new(timeToTween),
{CFrame = TweenCFrame}
)
Tween:Play()
If you want the time to change base off the angle.
Then time = math.abs((DesiredAngle-CurrentAngle)/degreesPerSecond)
Tweening over 48+ instances of motor6Ds and eventually putting them to a stresstest to see if it can handle big stages or venues with extreme detail would be horrific, considering they could most likely just lag.
As said above. math.sin(math.rad(45)) would be constant.
You should only use sin trying to figure out angle or to figure out the opposite or hypotenuse length using the angle and hypotenuse or opposite length
Trigonometric functions can be used to find Sides, that’s also their primary purpose.
But trigonometric functions can also be graphed, and the input of what you pass is very useful for effects.