generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: im new to lerping

Previous Thread :: Next Thread 
Lord_Oscar is not online. Lord_Oscar
Joined: 15 Nov 2009
Total Posts: 17662
23 Jun 2016 01:09 PM
currently just trying to get the arm to the part, not worrying about rotation...

i feel like its a stupid mistake because when i tried the same code on a different part (not trying to manipulate a weld) it works

local uis = game:GetService("UserInputService")

uis.InputBegan:connect(function(key)
if key.UserInputType == Enum.UserInputType.MouseButton1 then
for i = 1,100 do
game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 = CFrame.new(game.Players.LocalPlayer.Character["Left Arm"].CFrame.p):lerp(script.Parent.Handle.CFrame, i/100)
wait()
end
end
end)


It's simple physics
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
23 Jun 2016 01:15 PM
Lerping is a type of interpolation. Basically, it creates a line with a rotation matrix, and sets the distance between the start point and end point as one (not in studs, but a mathematical unit).

CFrame.thing= start_CFrame:lerp(end_CFrame,i) --where i is a number equal to or between 0 and 1


public static void main(String[] args) { System.out.println("Oops! Wrong language."); }
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
23 Jun 2016 01:17 PM
For this, why don't you just use "Left Arm"'s CFrame and lerp it like that. Converting it to .p removes its rotation matrix.


public static void main(String[] args) { System.out.println("Oops! Wrong language."); }
Report Abuse
Lord_Oscar is not online. Lord_Oscar
Joined: 15 Nov 2009
Total Posts: 17662
23 Jun 2016 01:32 PM
local uis = game:GetService("UserInputService")

uis.InputBegan:connect(function(key)
if key.UserInputType == Enum.UserInputType.MouseButton1 then
for i = 1,100 do
game.Players.LocalPlayer.Character.Torso["Left Shoulder"].C0 = (game.Players.LocalPlayer.Character["Left Arm"].CFrame):lerp(script.Parent.Handle.CFrame, i/100)
wait()
end
end
end)

this is what i changed it too... still flies around randomly


It's simple physics
Report Abuse
Lord_Oscar is not online. Lord_Oscar
Joined: 15 Nov 2009
Total Posts: 17662
23 Jun 2016 01:58 PM
...


It's simple physics
Report Abuse
guges is not online. guges
Joined: 07 May 2016
Total Posts: 1515
23 Jun 2016 02:04 PM
Because weld C0s and C1s are in object space
Report Abuse
Lord_Oscar is not online. Lord_Oscar
Joined: 15 Nov 2009
Total Posts: 17662
23 Jun 2016 02:40 PM
Alright now i just slide around the map....


It's simple physics
Report Abuse
Lord_Oscar is not online. Lord_Oscar
Joined: 15 Nov 2009
Total Posts: 17662
23 Jun 2016 03:28 PM
123


It's simple physics
Report Abuse
Lord_Oscar is not online. Lord_Oscar
Joined: 15 Nov 2009
Total Posts: 17662
23 Jun 2016 05:49 PM
456


It's simple physics
Report Abuse
Lord_Oscar is not online. Lord_Oscar
Joined: 15 Nov 2009
Total Posts: 17662
23 Jun 2016 06:56 PM
789


It's simple physics
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image