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: Freely moving joint

Previous Thread :: Next Thread 
DevUndead is not online. 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
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
14 Aug 2015 12:37 AM
I <3 sinusoidal functions
Report Abuse
DevUndead is not online. 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 is not online. 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
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
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 is not online. 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 is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
14 Aug 2015 02:05 AM
What do you mean freely?
Report Abuse
DevUndead is not online. DevUndead
Joined: 24 Jul 2014
Total Posts: 558
14 Aug 2015 02:21 AM
Said it clearly, "simulate a bucket handle"
Report Abuse
TimeTicks is not online. 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
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
14 Aug 2015 03:25 AM
LOL thanks :p I take my math seriously.

...but was it epicly unnecessary?
Report Abuse
FactualTheory is not online. FactualTheory
Joined: 10 Sep 2013
Total Posts: 1365
14 Aug 2015 03:29 AM
jeez phoenix can u tutor me lol

jks dont really
Report Abuse
Chrapnel is not online. 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 is not online. 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 is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
14 Aug 2015 11:39 AM
You can try using the glue
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