Need advice/help on friction collision of two actors (Fighter on Ropes/Cage).

rutherglen

  • Posts: 33
Hi,

I'm working on a game at the moment and I'm only about 20% of the way through. I'm stuck with the collision physics of my actors and the ropes or cage. I've made the settings ice, so no friction for both actors. However this makes the actor just slide along the sides all the time. If I adjust the settings the actor gets stuck.....

I've made a second quick build and this time it works without sliding everywhere but I don't want to have to re-do all the stuff I've done on this build so far to start again.

Could anyone tell me how to make it so that the borders stop my actors from going through them but has no "physical" force upon them.

Apologies in advance if I don't reply for a couple of days.

The arrow keys move the player. A and D to punch (not that it does much at the moment, working on kicking too. Again I have lots to add). Press return to select. Press R in the ring or cage to return to main menu.

http://curlingstoned.com/rf_games/Fightvsd2020/

« Last Edit: December 31, 2020, 05:40:50 am by rutherglen »

Luyren

  • *
  • Posts: 2506
Here is how to handle friction: https://youtu.be/97M4hchcfwI

Not sure if I understood your other question properly, but you can set one of your actors to "cannot be pushed" or "cannot move" and it might do what you described.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

rutherglen

  • Posts: 33
Thanks for the quick reply Luyren.

Yes I have the ropes and cage actors set to cannot move. I have invisible borders to stop my fighters from exiting the ring or cage. The only problem is when my fighters walk up against them they start sliding everywhere?.....

I've done a quick build which I'll link to here where the same physics are set but It doesn't make my fighter slide everywhere (which is the effect I want).

Let me see if I can upload my second build. There's no differences as far as I can tell between the two builds.....

rutherglen

  • Posts: 33
Here's the link to the second build, If you pick the first fighter (it's the one I could be bothered to work on the most in the experiment demo build) everything works fine when he walks along the ropes:

http://curlingstoned.com/rf_games/fightvsbuild2/

Luyren

  • *
  • Posts: 2506
Your first build link has no slowdown code neither friction setting, and the second build has either the slowdown code or friction set, is that it? If you already have a build that works as you want, I fail to see the problem.

Your actor is sliging because your ring bounds are slopes. If you simply move an actor against a slope, it will slide against it, that's expected. If you have a stop/slowdown code on the first build, it's not being triggered when you stop while moving against these slopes, or the interaction between your code and the slopes is launching your actor all around, so issues on that regard are on your movement code rather than physics settings.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

rutherglen

  • Posts: 33
Thanks for the reply Luyren,

I haven't coded any slow down codes in either of my movements for both builds, but reading through your reply I think I will need to do this... It's strange how one build works and the other doesn't..... Both builds are the same, same coded movement and same friction settings.

I agree if one of the builds works I will just have to use that one. It just means a weeks worth of my free time to get it to the same stage as my other build.

I'm going to continue with other parts of the game for now and will probably need to ask more questions in the near future as I'm struggling with enemy AI following player. Reading the forums I think there's a Stencylforge resource for this, but I want to see if I can code it myself for now.

Here's where I am at the moment http://curlingstoned.com/rf_games/Fightvs6.3.1.2021/

« Last Edit: January 06, 2021, 07:58:31 am by rutherglen »