Qorm
|
  |
| Joined: 25 Jul 2010 |
| Total Posts: 1650 |
|
|
| 22 May 2015 03:37 PM |
ok so im not the best at math so help would be appreciated
how would i increment the base of a part to floor1 perfectly? for example:
for i=base.Position.Y,floor1.Position.Y,0.01 do p.CFrame=p.CFrame*CFrame.new(0,0.01,0) wait() end
then the base would move to floor1 with 0.01 increment. what im trying to figure out is how to move the base to floor1 perfectly incremented, sort of like a quadratic function
this is a terrible explanation so yeah ask questions if your confused |
|
|
| Report Abuse |
|
|
Unplane
|
  |
| Joined: 24 Mar 2015 |
| Total Posts: 38 |
|
|
| 22 May 2015 04:24 PM |
| I have a question what does p = ? |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
| |
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 22 May 2015 04:28 PM |
| So what are you trying to do? Move the part "p" to the CFrame of floor1? |
|
|
| Report Abuse |
|
|
Unplane
|
  |
| Joined: 24 Mar 2015 |
| Total Posts: 38 |
|
|
| 22 May 2015 04:29 PM |
I love how he didn't even specify what p equals.
Also, lol @quadratic function
:P |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 22 May 2015 04:31 PM |
Well, if you want it perfect, use a CFrame interpolator or :Lerp(). I'll just use Lerp for now
for i = 0, 1, .01 do wait() p.CFrame = CFrame.new(P.Position:Lerp(floor1.Position. i)) end |
|
|
| Report Abuse |
|
|
Qorm
|
  |
| Joined: 25 Jul 2010 |
| Total Posts: 1650 |
|
|
| 22 May 2015 04:58 PM |
"how would i increment the base of a part to floor1 perfectly?"
'p' is the base |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 22 May 2015 05:00 PM |
Like, smoothly?
pos = posStart + (posEnd - posStart) * (duration/currentTime)^4 |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 05:36 PM |
I'm tired so i could be wrong. but don't you mean this?
pos = posStart + (posEnd - posStart) * (currentTime/duration)^4 |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 22 May 2015 05:38 PM |
you could take the easy way out (BodyPosition)
it would only work i think if you aren't moving a whole model, but it didn't look like you were anyway |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
|
| 23 May 2015 05:00 AM |
What is this? A tweening part thing?
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|