Hello to everyone. I have a character that progresses on the platform in my game. How can I prevent my character from going off the platform? Is there a node or Java Script code for it?
Thanks for the answer, but that's not what I'm looking for. My game has a gameplay like in the photo. I control my character with 4-way swipe. I want my character not to act outside of my platform. I want to prevent this when I want to leave the platform.
What I understood is that you want disable 4-Way swipe node when the character is outside of platform ? right ? if that what you want, you can add script with one variable, two input signal and two output signal connected to state machine ( 2 state one connected to 4-way swipe and second unconnected when touch the platform(first input) var = true and first output signal is true when outside of platform (second input) var = false and second output signal is true
now i get it, after you edit your post, well, of course it's possible using code and there are a lot of ways can build this functions like.... you can set 4 objects and put one of them at each corner one enable right, 2 left, 3 ahead, 4 back and 4-Way swipe node connected to script node with 8 inputs and 4 outputs first 4 inputs connected to 4-WaySwipes and others connected to if collide or receive node from 4 objects if collide object 1 right enable and all others disabled so if swipe right then..... if collide object 2 left enable and all others disabled so if swipe left then..... and so on.... i think it's a simplest way to build this function.... hope this is help
This is my node sort. but it does not prevent the character from going off the platform. Because I don't know how to introduce the off-platform area.
https://drive.google.com/file/d/1wbqTf6FaOyGvv531I8qhY2xBC6iWXdId/view?usp=sharing this is a simple move system understand script node inside character (it's very simple) to add or change what you want
Thank you for your effort, buddy. Works perfectly for fixed platforms. But I am looking for a solution for mobile platforms. For example, the platform does not work when you change direction with rotation animation.
I only developed an idea for you, not an completed system, just a rudimentary system as i told you, understand this script and build what you want, the final result may be complicated...