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: How do i use Stravants interpolator

Previous Thread :: Next Thread 
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
16 Jun 2015 07:21 AM
I might be able to use it on a gun, to replicate litozinamons work.

I have a dream, you cannot crush it.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
16 Jun 2015 07:22 AM

Learn how to interpolate yourself. It is easy ._.
Lerp lerp lerp
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
16 Jun 2015 07:25 AM
Im not that advanced.

I have a dream. You cannot crush it.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
16 Jun 2015 07:26 AM

1. Get advanced by realizing it is basic
2. Get kinky
3. Get even more kinky
4. Want to get kinky?
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
16 Jun 2015 07:27 AM
I dont know how to interpolate, only loop cframe! and terribly!

I have a dream. You cannot crush it.
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
16 Jun 2015 07:48 AM
Fat of help you guys give.

I have a dream. You cannot crush it.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
16 Jun 2015 07:49 AM

local lerp = function(a,b,c)
return (1-c)*1 + c*b
end

local lerp_vec3 = function(v1,v2,c)
return Vector3.new(
lerp(v1.X,v2.X,c),
lerp(v1.Y,v2.Y,c),
lerp(v1.Z,v2.Z,c)
)
end

lerp lerp lerp

Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
16 Jun 2015 07:51 AM
Move halfway between two points

local Point1 = Vector3.new(0,0,0)
local Point2 = Vector3.new(10,10,10)

local end = lerp_vec3(Point1, Point2, 0.5)

print(end)
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
16 Jun 2015 07:54 AM
Oh i see so i do this

part:lerp(StartPos,EndPos,Increment)

I have a dream. You cannot crush it.
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
16 Jun 2015 07:58 AM
So this is what i have on my interpolator

local function Interpolate(Part,Pos1,Pos2,Inc,EndPos)
repeat
Part:lerp(Pos1,Pos2,Inc)
game:GetService("RunService").RenderStepped:wait()
until Part.Position == EndPos
end

Correct?

I have a dream. You cannot crush it.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
16 Jun 2015 07:59 AM

No.

part.Position:lerp(EndPos_vec3, alpha_normalized_number)

Basically...

part.Position:lerp(Vector3.new(10,10,10), 0.5)

Mine is better though because you can now lerp outside of Vector3
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
16 Jun 2015 08:08 AM
no workyyyyy

I have a dream. You cannot crush it.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
16 Jun 2015 08:09 AM
local function Interpolate(Part,Pos1,Pos2,Inc)

for i=0, 1, Inc do
Part.Position = Part.Position:lerp(Pos1,Pos2,Inc)
game:GetService("RunService").RenderStepped:wait()
end

end
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
16 Jun 2015 08:32 AM

This is the code I used for testing. It works flawlessly, but it needs to be edited for moving forward towards something rather than space increments without direction.

local lerp = function(a,b,c)
return (1-c)*1 + c*b
end

local lerp_vec3 = function(v1,v2,c)
return Vector3.new(
lerp(v1.X,v2.X,c),
lerp(v1.Y,v2.Y,c),
lerp(v1.Z,v2.Z,c)
)
end

local Lock = false

local LerpTo = function(Part, mouse, incre)
if(not Lock)then
Lock = true
local ppos1 = Part.Position
local ppos2

for i=0, 1, incre do
ppos2 = mouse.Hit.p
Part.Position = lerp_vec3(ppos1, ppos2, i)
game:GetService("RunService").RenderStepped:wait()
end

Lock = false
end
end


local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.Move:connect(function()
print("Move")
LerpTo(game.Workspace.Part, Mouse, 0.01)
end)
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