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: why on earth does roblox's lerp function

Previous Thread :: Next Thread 
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
27 Feb 2015 11:04 AM
only work on vector3 objects

it would actually take less effort to make it work on both floats and vector3s since they can both have arithmetic performed on them
Report Abuse
Waffloid is not online. Waffloid
Joined: 14 Jul 2011
Total Posts: 1606
27 Feb 2015 11:25 AM
because

thats roblox for you
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
27 Feb 2015 11:46 AM
because

1:lerp() -- syntax error

and (1):lerp() -- attempt to index a number value
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 Feb 2015 12:00 PM
("Hi"):reverse() --Attempt to index a string value
Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
27 Feb 2015 02:53 PM
@dig
ive made my own lerp function which has no problem running both vectors and floats

function cLerp(a,b,step)
return ((a-b)*step)+a
end

This lets you use:

vec1:cLerp(vec2)
and
float1:cLerp(float2)


why does this work? because the vector3 class can have arithmetic performed on it

so im just curious why the design of their function is to only accept vector3s. its an arbitrary limitation for its own sake, itd seem
Report Abuse
LuaJake is not online. LuaJake
Joined: 20 Jun 2013
Total Posts: 2009
27 Feb 2015 03:26 PM
Use .magnitude then use some math
Report Abuse
MiniNob is not online. MiniNob
Joined: 14 May 2013
Total Posts: 822
27 Feb 2015 03:27 PM
"some math"
Report Abuse
LuaJake is not online. LuaJake
Joined: 20 Jun 2013
Total Posts: 2009
27 Feb 2015 03:30 PM
Use (point1.Position - point2.Position).magnitude*alpha, which is a decimal
Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
27 Feb 2015 03:42 PM
@luajake
i get it and ive already found a better solution to it

you can use magnitude and some math, just get one of the vector's values, make your own function, et cetera

im just pointing out how weird it is that you have to do that in the first place
Report Abuse
LuaJake is not online. LuaJake
Joined: 20 Jun 2013
Total Posts: 2009
27 Feb 2015 03:42 PM
Yeah, it'd be much easier if :Lerp() was implemented for other objects.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 Feb 2015 03:44 PM
ModuleMaker has an interpolation module which allows you to interpolate pretty much everything on Roblox.
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
27 Feb 2015 03:47 PM
Well considering that a Vector3 is basically a table and lerp is a method in that table and that floats are a datatype and datatypes don't have methods, it seems very obvious why floats don't have a lerp method.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 Feb 2015 03:57 PM
"datatypes don't have methods"
And of course no datatypes have EVER had some feature like this
("Hi"):reverse()
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
27 Feb 2015 04:01 PM
Strings are tables of characters. gg
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