- Home /
Player(Squre) move along fixed line (which can be straight , incline, circuler etc) with inputs of joystick !
hello, I am trying to make game in which`there is line created by me before the start of game(not like in running game) and player(Squre) only can move along that line by joystick like if I go forward in joystick it go forward in line , if I go backward it goes backward in line , if I go up or down it turn in the line( if there is any turn). That means that forward, backward, up,down is globally and also if my line is in horizontal direction and i pull joystick up then it will not move from the line in vertical direction of line path. so, it is like line following (with input ). so, what kind of code it has to take.. I don't know whether I use boxcolider on adjacent to line or anything else after using box collider it does not look good so what should I use for this type of problem? Thank you for Advance!
Answer by Siro13 · Jul 31, 2020 at 07:29 AM
Hello, I am interested in this topic. I noticed a serious lack of official documentation regarding the possibility of making the character move only on a line or a curved path. I studied tons of documentation on how to implement bezier curves and make them uniform. An excellent tutorial I found on Youtube is done by Sebastian Lague. Despite this, I do not explain why there is nothing on the official Unity website. I need a system to constrain my character's movements in a 2.5D Platform, like Klonoa 2 or Pandemonium, but nothing decent is found. I hope that some genius, among the Unity developers, can provide some education or example, because in my opinion this is a very important topic in the development of video games. Thanks bye