Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by winman · Mar 16, 2012 at 08:37 AM · draw

Draw to follow

I want to make a game like this: http://www.youtube.com/watch?v=dkp9pxYts_w&feature=player_embedded How to draw path for an object to follow? Can give me some tutorial or suggest,please! thanks!!

Comment
Add comment · Show 9
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Mar 26, 2012 at 02:21 PM 0
Share

i have edited the script. list of updates : the Sphere now moves in normal time, not how fast or slow the mouse was dragged; the Sphere now moves as soon as dragging is started; fixed errors from if mouse button was down or released during moving.

$$anonymous$$y next step is to only move the sphere if it is clicked on first. I shall let you know when more is working.

avatar image winman · Mar 27, 2012 at 05:58 AM 0
Share

thanks :))

avatar image AlucardJay · Mar 28, 2012 at 05:18 AM 1
Share

This is what I am up to :

http://www.alucardj.net16.net/unityanswers/Aircraft1-1.html

As there has been some interest in this, I am going to write a guide on how I made this. I shall let you know when I have something ready.

avatar image SaurabhBorwankar AlucardJay · Dec 10, 2016 at 08:34 PM 1
Share

I am trying to access http://www.alucardj.net16.net/unityanswers/Aircraft1-1.html and http://www.alucardj.net16.net/unityanswers/ScriptFollowAfterDrag.js but these links are broken. Can you help? Thanks!

avatar image Czar-Man AlucardJay · Jan 04, 2017 at 07:51 PM 0
Share

Same here. Could you provide us with an alternate website if one exists? I'd really like to learn how to make this.

Thanks!

avatar image winman · Mar 28, 2012 at 06:32 AM 0
Share

:)) thank for your help

avatar image winman · Apr 17, 2012 at 05:22 PM 0
Share

mmm, i have a problem, now, when the aircraft is moving,i touch the aircraft again and move it, the aircraft will move another path , the old path and path$$anonymous$$arker will destroy. Can give some idea?

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
5
Best Answer

Answer by AlucardJay · Mar 27, 2012 at 08:35 AM

Just like @rutter has layed out. Here is my first answer and script :

http://answers.unity3d.com/questions/231349/object-follow-the-mouse-path.html

Edit : While it is not encouraged to write full scripts for people on this 'site, I have made a guide for this, following the steps I took to make this. Just keep in mind that I am a noob, this is just to help out other noobs :)

Make a Simple AirCraft Controller Game in Unity

Here is the link for the player following after mouse has been dragged script :

http://www.alucardj.net16.net/unityanswers/ScriptFollowAfterDrag.js

@Bunny83 - Thankyou for the thought and comment =]

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image YUSHI · Apr 01, 2012 at 07:28 AM 0
Share

hi alucardj can you tell, How to equidistant create path Thank you!!

avatar image AlucardJay · Apr 01, 2012 at 08:12 AM 0
Share

I thought of 3 methods to equally place the path markers. 1/ have a separate gameObject draw the path, 2/ put a counter in the script to place a marker to a time-step, 3/ learn how to use Trail Renderer. $$anonymous$$ethod 2 would be tidy in keeping everything on the one script, $$anonymous$$ethod 3 I want to learn how to do. But I have been busy on other projects, when I get back to this I shall post my updates.

avatar image YUSHI · Apr 01, 2012 at 12:58 PM 0
Share

Ok,Thank you!!Can I ask a question?How to drawing path the finished then when onmouseup ,Players move?Players is 3d Object. Like:http://www.youtube.com/watch?v=kv-_9$$anonymous$$fwJt8

avatar image AlucardJay · Apr 10, 2012 at 02:37 PM 0
Share

this script should help you : http://www.alucardj.net16.net/unityanswers/ScriptFollowAfterDrag.js

avatar image YUSHI · Apr 16, 2012 at 03:22 PM 0
Share

Hi,alucardj,thank you for your help. $$anonymous$$y Camera set Position (168.3342, 215.449, 95.12489) Rotation (59.10774,-90,1.525879e-05).$$anonymous$$y player is 3D object.When I use script no response. And how can player move speed Isokinetic ,because I use mouse drawing slow ,player move is slow,drawing fast,player is fast,and I want to when hit player ,player to move.Please tell me how to do.

Show more comments
avatar image
2

Answer by rutter · Mar 16, 2012 at 04:57 PM

Break a big problem into smaller problems:

  • Map finger touches to points in world space

  • Create a "path" structure, which tracks those points

  • Create objects that can follow the path

  • Create objects that can draw the path

Mapping touch to location is one of the most common questions on this board.

At the very least, you'll want to track the touch positions with some kind of list. You may want to run some sort of smoothing on user input, but that can get rather complicated.

There are many ways to follow a path. The simplest is probably Vector3.Lerp() or something similar.

For drawing paths, you'll want a line renderer or something similar.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image winman · Mar 17, 2012 at 03:34 PM 0
Share

Can you give some project or Website? let me research

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

OnDrag Draw Line For Pathfinding... 1 Answer

Aim preview for projectile trajectory 1 Answer

Drawing with mouse on GUI or world texture 1 Answer

650+ DrawCalls, Mesh.DrawVBO 1 Answer

Correct way to draw on screen for 2D game 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges