I’m just starting out with Unity, and am wondering if anyone could point me in the direction of tutorials/resources that might, at the very least contain examples of what I’m about to describe.
I want to trace a path on the screen with my finger, and, once I let go, a character (from which that path begins), follows the path at a variable speed. Along the path events are triggered, that need to be resolved by the player (in a kind of a cut-scene, leaving the main game greyed out and paused in the background). The character should then resume its progress along the path. The player has 2 seconds to draw a path, and it can be any shape; so curves, not much in the way of straight lines…
I’m following this tutorial, currently (http://www.rocket5studios.com/tutorials/make-a-2d-game-in-unity3d-using-only-free-tools-part-1/), but that’s not going to cover much of what I need. I’d be very grateful if people could direct me to useful info. I’m more than happy to dive in and look for things myself, too, but there’s so, so much out there, and I’m such a newbie, that sometimes I don’t even know if I’ve already been staring at the answer.
Oh, and also, if I’m trying to write this little thing for Windows, iPhone and Android, how do I account for a mouse-drawn path on Windows, versus a finger drawn path for mobile?
(I’m using Unity free, 3.5, with the basic Android and iPhone plugins).
Is there something wrong with my questions? Am I asking something that’s either too simple to merit an answer, or asked too often? Is it that my questions don’t make any sense? I’ve tried searching Google and the forum for this, but, like I said, if the answer’s out there I’ve not noticed it. I think it’s more likely that the sort of thing I want to do, if it exists in tutorial form, would be something that’s in the middle of a full game tutorial, or something like that.
Any clues/hints/pointers/examples at all would be absolutely life-saving. Ok, that may be a little over-dramatic!
I think this question is too specific and “large”. By “large” I mean, the answer would be rather large and require some thinking and ingenuity on answerer’s part.
It’s as if someone asked: “How do I make a flying car?” There’s just sooo many things involved and almost no one has ever tried to do it before.
I doubt that such a tutorial exists since what you want to do is very specific. You could find a tutorial on making a car and one on making an airplane but for something as specific as a flying car, you’d need to continue from there by yourself.
So, you need to learn Unity and then try to build that game with what you know.
I might be wrong though, I’m not a Unity expert.
If I were you, I’d start with learning how to place some objects automatically along the drawn path. That is, the objects would position themselves as the user is drawing a line. Then I would use those objects as nodes for a character to move from one to the next.
That would involve the knowledge of raycasts, colliders and vector-geometry.
Ok, I hear you, and thanks for that. Really, nobody’s ever used Unity to make a character follow a finger-drawn path? Well, if I DO end up being the first, I’ll be sure to post my findings/method!
Maybe someone has, but it’s so rare that the chances of him reading this thread are pretty low
Just think about it, how many games where character follows a drawn path have you seen, as opposed to platformers, or first-person shooters? I’d bet the ratio is worse than 1:1000, if any. So it surely requires some research and testing different approaches.
If you wanted a character to follow your finger or pointer in real time, as you drag it, that’s a different thing and is easily achievable by projecting the position of your pointer/finger to a surface.
I’m already thinking about changing my requirement to having the character follow a bunch of screen-tapped waypoints, but, the real-time drag thing…perhaps I could do that in the background, record the path taken, somehow, and then play the actual animation back to the player once they’ve let go of the screen…