Conveyor Belt movement issue
Chr0nos
Wondering Vagabond AustraliaMember Posts: 113
Hi all,
I am currently trying to figure out how to get my actor to be able to have free movement on a conveyor belt.
I created the conveyor belt by going into my Hero actor and adding the change attribute self.motion.linear velocity X to 100 (when overlapping or colliding with the conveyor belt actor), so the conveyor belt pushes him to the right no worries. But I have absolutely no control over him when he's touching the conveyor belt. Its like he has no move rules at all.
The hero needs to be able to walk against the conveyor belt, and jump while he is on it.
Any ideas?
Thanks in advance.
Comments
Hello -
I haven't used linear velocity before, so I can't opine on that, but a possibly less elegant way to look at it would be something like the following.
Let's say the conveyor belt is on, and will move the player to the right if the player is at a standstill on the belt. If the player moves left, then he won't be dropped off the conveyor belt.
If attribute left button is pressed and
attribute player on left-facing conveyor belt is true then
move player left at 50 percent of normal movement speed
otherwise (else)
move player right at conveyor belt speed
To me, the key here is that the game should recognise you are standing on top of the conveyor (colliding with it). Maybe you need to do a visible conveyor belt and an invisible actor on the top side of the conveyor belt.
Let us know your solution! Regards.
My Blog / App Store / Google Play
Hey thank you @mhedges , I will definitely give this a try.
Monster Robot Studios has a nice tutorial on how to move a character while it's on a moving platform. That might be helpful for your needs.
I'd post a link but youtube doesn´t seem to work for me right now.
Search for it. If i remember correctly, it was the "Platformer Part III" tutorial.
Mental Donkey Games
Website - Facebook - Twitter
It's way more simple than any of this, I'm fairly new to Gs too. But if I am not mistaken, the converter belt should change linear velocity like this:
If colliding with converter: Change linear velocity to linear velocity + conveyer belt speed. This should incorporate your existing controls.
Thanks! I will check that out.
@joshiwu ,
Should I put the rule for the conveyor belt inside my existing rules for movement?