DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 14 Aug 2015 12:37 AM |
| How can I simulate a bucket handle with physics? I'm a nob so shoot me down. |
|
|
| Report Abuse |
|
|
| |
|
DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 14 Aug 2015 12:39 AM |
| uwot? I do seriously need to know what class I need to use for this, and if not a class then what is my best method of simulation. |
|
|
| Report Abuse |
|
|
DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 14 Aug 2015 12:45 AM |
*attaches rocket to thread*
*thread spirals to the roblox ceiling*
*rocket hits the ceiling and makes a BUMP sound* |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 01:08 AM |
Mmm trigonometric function time!
Player -Backpack ---Bucket ----Handle ----LocalScript
p = game.Players.LocalPlayer --w = p.Character.Humanoid.WalkSpeed _walking = false
h = script.Parent.Handle a = CFrame.new(0,0,0) _v = "X" --Change to whichever direction it's supposed to swing
sinu = {} --These are variables for the math. You can play with them if the swing is off sinu.a = 1 --Max_Value = sinu.a+sinu.d; Min_Value = -sinu.a+sinu.d (swing range) sinu.b = 1 --Eh, don't mess with it I guess sinu.c = 0 --X Offset (probably don't need to change it) sinu.d = 0 --Affects max and min values
coroutine.wrap(function() local pos = p.Character.Torso.Position local _n = 0 while wait() do wait() if pos == p.Character.Torso.Position then _n=_n>0 and _n-.1 or 0; _walking = false return end _walking = true pos = p.Character.Torso.Position _n = _n < sinu.a and n+.1 or 1 end end)()
coroutine.wrap(function() local count = 0 while true do if _count==10 then _count=0 end _count = (_walking and _count<10) and _count+1 or (not _walking and _count>0) and _count-1 wait() _y = _n*math.sin((sinu.b*_count)+sinu.c)+sinu.d if _v:upper() == "X" then h.CFrame = h.CFrame * CFrame.fromEulerAnglesXYZ(_y,0,0) elseif _v:upper() == "Y" then h.CFrame = h.CFrame * CFrame.fromEulerAnglesXYZ(0,_y,0) else h.CFrame = h.CFrame * CFrame.fromEulerAnglesXYZ(0,0,_y) end end end)()
You can try that...just wrote that offhand so no idea what bugs there are. |
|
|
| Report Abuse |
|
|
DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 14 Aug 2015 01:27 AM |
Those lines sound great but ahem
local player = game.Players.LocalPlayer local LanternWeld = -- the weld used to pivot local Intensity = 1 -- probably needs to be adjusted local torsoVel = Vector3.new() local function LanternSwing() local torso = player.Character.Torso local vel = torso.Velocity local accel = torso.CFrame:pointToObjectSpace(vel - torsoVel + torso.Position).z LanternWeld.C0 = CFrame.fromAxisAngle(Vector3.new(1,0,0),accel*Intensity) torsoVel = vel end game:GetService("RunService"):BindToRenderStep("LanternSwing",1000,LanternSwing)
Are there really no joints on roblox for this yet? |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 14 Aug 2015 02:21 AM |
| Said it clearly, "simulate a bucket handle" |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 14 Aug 2015 03:12 AM |
holy sht phoenix went overkill
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 03:25 AM |
LOL thanks :p I take my math seriously.
...but was it epicly unnecessary? |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 03:29 AM |
jeez phoenix can u tutor me lol
jks dont really |
|
|
| Report Abuse |
|
|
Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
|
| 14 Aug 2015 03:54 AM |
erm guys...
rotate joint to connect arm to bucket handle
two other rotate joints to connect handle to bucket
e.e |
|
|
| Report Abuse |
|
|
DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 14 Aug 2015 11:07 AM |
| @above is what I was looking for, Jesus. |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 14 Aug 2015 11:39 AM |
| You can try using the glue |
|
|
| Report Abuse |
|
|