Region Attributes for Swimming

TheArtisan

  • Posts: 11
I'm making a platform game with swimming in it. I'm trying to use region attributes to make water that changes the controls from Jump and Run to 8 way movement without gravity. It's just that even though I set the region's attributes to water, the game doesn't recognize the player jumping in water at all, and stays with the Jump and Run controls. Does anyone have a method of making water the player can swim in that I can follow?

mebloo

  • Posts: 128
You seem to be in the right way of using a region for the water.
You don't show us any piece of code so it will not be easy to help. Are you not using the "Flow" block "When [Actor Type] enters [Region ]" ?

mebloo

  • Posts: 128
And check if you have "Collisions" enabled as well for your swimming Actor ?

TheArtisan

  • Posts: 11
Well, I have a picture of my most recent code, as well as the region the character's meant to swim. I must admit, when I made my first level, I duplicated it to make other ones. The original had different regions, and in the newer ones the regions there don't trigger in the place they're meant to. I tried making the swimming region as long as the scene itself, but that didn't fix the problem at all.

mebloo

  • Posts: 128
First of all, I think you put your logic at the wrong place. Blocks such as "Disable behaviour" are actions that should be performed only once when an event occured and not all the time.

I think you need two things :
1) First, you can't use these blocks by checking if your player "is inside" the region : the behaviours should be enabled / disabled only once when your player is entering / exiting the region.
2) Do not use the Always block (and the event "When updating" if you're using these actions. You have specific events regarding regions so you could use them.

I think it will be better and optimized a little more that way.

TheArtisan

  • Posts: 11
I've tried what you suggested, but it doesn't seem to have done anything. The character still jumps around underwater.

yoplalala

  • *
  • Posts: 1632
Check if it detects " is inside" or "enter"
by putting a print inside it
like print("player entered Underwater")
Do you see the print in the log ( ctrl-5) ?