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
 

What would you use for an elevator type object?

Previous Thread :: Next Thread 
Cyerwyn is not online. Cyerwyn
Joined: 09 Mar 2013
Total Posts: 3442
27 Jul 2016 09:34 AM
If I had a sort of pod like object which would be lowered into the ground, what would I use?
Report Abuse
Everoso is not online. Everoso
Joined: 26 Jul 2016
Total Posts: 189
27 Jul 2016 09:35 AM
Uhh, either body movers or lerp it with CFrame.


Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
27 Jul 2016 09:36 AM
it depends how you want it to work

if you want it to run on roblox's physics, use a bodymover object like bodyvelocity or bodyposition

you can also do it through cframe which is more reliable but not physics based
Report Abuse
Cyerwyn is not online. Cyerwyn
Joined: 09 Mar 2013
Total Posts: 3442
27 Jul 2016 09:36 AM
This is actually in relation to the union thing, here I'll post the script.

allp = script.Parent
pb = allp.pb
pm = allp.pm
pt = allp.pt
cp = allp.ctpanel
act = cp.SurfaceGui.Activate.TextButton
deact = cp.SurfaceGui.Deactivate.TextButton
status = cp.SurfaceGui.StatusActual.TextBox


act.MouseButton1Click:connect(function()
print("ACTIVATED")
status.Text = "ACTIVATED"
status.TextColor = BrickColor.new(0, 255,0)
for i,v in pairs(allp:GetChildren()) do
if v.ClassName == "UnionOperation" then
print("Union detected!")
for i=1, 10 do
wait()
v.CFrame = CFrame.new(0, -10, 0)
end
end

end

end)


deact.MouseButton1Click:connect(function()
print("DEACTIVATED")
status.Text = "DEACTIVATED"
status.TextColor = BrickColor.new(255, 0, 0)
end)



====

I tried using CFrame, but it goes all wonky and wrong. Any help would be greatly appreciated.
Report Abuse
Everoso is not online. Everoso
Joined: 26 Jul 2016
Total Posts: 189
27 Jul 2016 09:37 AM
I have a bad feeling that every glitchy elevator ever was using body movers.


Report Abuse
Everoso is not online. Everoso
Joined: 26 Jul 2016
Total Posts: 189
27 Jul 2016 09:37 AM
"pb = allp.pb"

This is sort of irrelevant but please have more descriptive variable names. I have no idea what pb is.


Report Abuse
Cyerwyn is not online. Cyerwyn
Joined: 09 Mar 2013
Total Posts: 3442
27 Jul 2016 09:39 AM
@Ever

pb, pm, and pt are union parts for the sections of the pod. Pb = Pod Bottom, Pm = Pod Middle, and so on.
Report Abuse
Everoso is not online. Everoso
Joined: 26 Jul 2016
Total Posts: 189
27 Jul 2016 09:40 AM
Word of advice: name the variables podBottom, podMiddle, and so on if you give the first crap about the quality of your code.

Anyway for the elevator I'm leaning towards CFrame:lerp()'ing it.


Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
27 Jul 2016 09:41 AM
CFraming it is probably more reliable. Just make sure it doesn't move too fast and causes you to fall through the floor.


( ͡• ◡ ͡•) -=[ RAP: 348,035 || DurstAuric; the narb of ROBLOX ]=- ( ͡• ◡ ͡•)
Report Abuse
Cyerwyn is not online. Cyerwyn
Joined: 09 Mar 2013
Total Posts: 3442
27 Jul 2016 09:44 AM
"returns a CFrame interpolated between this CFrame and the goal by the fraction alpha"

I'm sorry, what?
Report Abuse
Everoso is not online. Everoso
Joined: 26 Jul 2016
Total Posts: 189
27 Jul 2016 09:44 AM
Or weld them. Definitely weld them if it's fast-moving.


Report Abuse
Everoso is not online. Everoso
Joined: 26 Jul 2016
Total Posts: 189
27 Jul 2016 09:45 AM
In English:

It gets a CFrame part-way between the start and the end based on what you define (what you define is the "alpha").

So if I have part A and part B I can get a CFrame half way between them with it.


Report Abuse
Cyerwyn is not online. Cyerwyn
Joined: 09 Mar 2013
Total Posts: 3442
27 Jul 2016 09:49 AM
The wiki is so confusing, how exactly do you use cframe:lerp()?
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
27 Jul 2016 10:22 AM
local startcframe = CFrame.new(starting position)
local endcframe = CFrame.new(goal position)

local elevatorpart = part u want to move

for i = 1, 100 do
elevatorpart.CFrame = startcframe:lerp(endcframe, i/100)
wait()
end

that would move the elevator from the old position to the new position in 100 wait()s
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