character jumping on moving platform?
allc1865
Member, PRO Posts: 777
Hi. I want my character to be able to stand on a platform that moving. So far I have turned my density up to 1,000, which works, but if, say, my character bumps my platform, it'll go flying away. I have collisions set up already, and Also, I can't turn moveable off, because then it wouldn't move... So that wouldn't work. Any idea? Thanks!
Best Answer
-
-Timo- Posts: 2,313Sorry, my fault. It has to be <= and >= because it moving down to 76 and then its not smaller then 76 you also can use =
Answers
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
I don't know how you are moving it but you can try something like
if self.position.X < 100
interpolate self.position.X to 200
during 1 sec
if self.position.X >200
interpolate self.position.X to 100
during 1 sec
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
---for the speed of the platform---
self.Motion.Linear Velocity.Y to 200.
---constrain attribute---
self.Position.Y to self.Position.Y
---don't go higher than...--- ( for my Y coords to move the platform)
Rule > Attribute > self.Position.Y is greater than 276
Change Attribute > self.Motion.Linear Velocity.Y to -400
--don't go lower than--
Rule > attribute . self.Position.Y is less than 76
Change Attribute > self.Motion.Linear Velocity.Y to 400
My screen shots aren't working
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
In the first rule you put
If self.position.y > 276
Do
Interpolate self.position.y to 76
During 2 seconds (this is the speed)
In the second rule you put
If self.position.y < 76
Do
Interpolate self.position.y to 276
During 2 seconds (this is the speed)
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Is that right?
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
new rule saying actor receives event > overlaps or collides with actor of type > sliding block > change attribute: game.jump to false
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
I believe that may be my issue here. It's saying if actor is on the ground, turn to false. When I switched that to my sliding block, my black was false, however my ground was not.
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
https://www.dropbox.com/s/chhk19z7qukpzr3/jump temp..zip
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Thanks.
if ANY of the following are happening
overlaps or collide with land OR overlaps or collide with block
do
change jump to false
and when I open the project its bouncing up and down. is that something you want?
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Thanks for your help!