Object hanging from a rope
#1
Posted 17 June 2012 - 12:02 PM
Is it posible to make an object(crate) hanging from a rope swing a little from side to side when the game starts and when a moving object(Rock) hits it on the side it swings more.
After the rock hits the hanging crate and it swings I want it to eventually return to its original swinging speed (a little from side to side). I'm not sure if this is even possible but would appreciate any help.
Thanks!
#2
Posted 17 June 2012 - 12:17 PM
That being said... I don't really know enough about physics to tell you what the actual formula would be for determining position. x would probably be determined with some sort of x² and y would probably be the circle forumla (with the radius being the length of the rope), but again, I'm just taking a guess
Edited by dannyjenn, 17 June 2012 - 12:22 PM.
#3
Posted 17 June 2012 - 12:37 PM
Okay I see, I would like the realistic one where the swinging slows and eventually stops.That is definitely possible but it will require maths. However you do it will depend on the effect you want to achieve... do you want it to be realistic where the swinging slows and eventually stops or do you just want it to be constantly swinging back and forth?
That being said... I don't really know enough about physics to tell you what the actual formula would be for determining position. x would probably be determined with some sort of x² and y would probably be the circle forumla (with the radius being the length of the rope), but again, I'm just taking a guess
Do you know of some tutorial that maybe has something similar? Even if its not entirely what I want, I'll improvise.
#4
Posted 17 June 2012 - 01:08 PM
From Smart Codes
5:Tween a variable to 0 (like friction)..
Pretty much tweens a variable down to 0. Instead of using 2 if statements, you can just use one line of code.
variable -= sign( variable ) * min( abs( variable ), .5 )
--Edit
You can also browse this
Edited by C_Pike, 17 June 2012 - 01:11 PM.
#5
Posted 17 June 2012 - 05:24 PM
tween variable is what you are looking for for the swinging:
From Smart Codes
5:Tween a variable to 0 (like friction)..
Pretty much tweens a variable down to 0. Instead of using 2 if statements, you can just use one line of code.variable -= sign( variable ) * min( abs( variable ), .5 )
--Edit
You can also browse this
Right so I looked at the other forums you gave me the Google link to and the ropes those guys make are really cool but I don't need halve of the realism those guys used, all i want is a normal rope hanging from the roof, it doesn't even have to flexible, a straight line that looks like a rope with an object attached to it on the bottom end, if something collides with the object hanging on the rope it should start swinging and eventually stop swinging after some time. Sorry for the confusion at first I didn't know you could make such realistic ropes in GM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











