|
| 14 Jul 2012 03:01 PM |
if (toolAnim == "None") then --my cursor follow arm addition Cursor_Position = math.abs(mouse.Hit.Position) Arm_x = math.abs(Torso.Position.X - Cursor_Position.X) Arm_Y = math.abs(Torso.Position.y - Cursor_Position.y) Arm_Distance = (Arm_x * Arm_x) + (Arm_Y * Arm_Y) Shot_Length = math.sqrt(Arm_Distance) Arm_Z = math.abs(Cursor_Position.Z - Torso.Position.Z) Arm_Turn = Arm_Z/Shot_Length Arm_Angle = > = math.tan(Arm_Turn) RightShoulder.DesiredAngle = Arm_Angle return end
This is my substitute for the tool arm angle in the character animation script to make it follow your cursor up and down. Please find any errors for me! :) |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Jul 2012 03:21 PM |
RightShoulder.DesiredAngle = 1.57
This is the typical tool activation function. I'm finding the cursor height and distance so I can calculate the angle the arm should be at so in first person the arm follows the cursor. I was wondering, hoever, if there would be a specific conversion factor to convert the angle to roblox angles, because the starting angle was 1.57, not 90. Perhaps subtraction? Or maybe division? Please help! |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 03:23 PM |
I have a feeling you don't know the math you're using.
I'll be frank; I know very little. (Grade 8 doesn't teach you very much). |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 14 Jul 2012 03:39 PM |
| Lol I just got done with eight grade too. I know what you mean. I have quite a few good friends and hard schooling, so regardless of whether I want it to or not, roblox almost always comes last. Please though! Anyone else that can help! |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2012 03:40 PM |
| I looked up an online lua library, thats how i got the functions and operations! |
|
|
| Report Abuse |
|
|