• 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
0
Question by robertofantasy · Sep 08, 2012 at 11:33 AM · 2dtargetting

2d targetting problem

hello my friends here is my question i have enemy that i want shoot my player and i want when it shoots , the projectile go linear to my player i mean when i move my player to avoid the projectile , the projectile dont follow just go to its path linear and surely it is a 2d game i dont know how can understand you my problem

please write the code in c#

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 Piflik · Sep 08, 2012 at 11:36 AM 2
Share

Please write the code yourself.

If you don't want to code yourself, hire a programmer.

avatar image robertofantasy · Sep 08, 2012 at 12:57 PM 0
Share

if i know how to implement this i dont ask i know how to code myself if you dont know just pass the question my friend

avatar image robertofantasy · Sep 08, 2012 at 12:58 PM 0
Share

is anyone want to help me

avatar image Piflik · Sep 08, 2012 at 01:05 PM 0
Share

This site is not the right place to ask for free code. We are here to help others with their code, when they run into problems-

avatar image AlucardJay · Sep 08, 2012 at 06:02 PM 1
Share

Yes, this OP has been asking for help before, but I think it is a language barrier issue also happening : http://answers.unity3d.com/questions/314030/curve-like-animation.html

However, and consider the OP does provide code of their own (I couldn't help here as it is in C#) : http://answers.unity3d.com/questions/312562/flaoting-move.html

These are just the questions I have seen, and even without looking at the others I I give the benefit of the doubt that this person is simply looking for advice, then help, snippets, pseudocode, and tutorials.

$$anonymous$$y standard answer for tutorials in C# is :

Bergzerg Arcade : http://www.youtube.com/user/BurgZergArcade?feature=CAQQwRs%3D ,

3D Buzz : http://www.3dbuzz.com/vbforum/sv_videonav.php?fid=808bf515c69066eb13df7952c0d54711 ,

and : http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html

As I said before, I think this may be a language barrier problem, the OP wants to learn =]

Edit : I am upvoting you @robertofantasy , to help with your karma, and because it is a cool screen name (and you write in C#) =]

Show more comments

1 Reply

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

Answer by AlucardJay · Sep 09, 2012 at 06:17 PM

From the description, I am imagining a 'space invader' type of game, where the enemy shoots in a straight line, and the player moves to avoid this.

Here is a tutorial (that was converted to C# by the people at 3D Buzz, see link for more info), it is a 2D Space Shooter, but I think it will help you get started in programming. It is in C# , and there are some nice free assets also!

Download each part of the tutorial, then follow along (assets at end of list) :

http://forum.unity3d.com/threads/37093-Over-7-hours-of-Unity-Training-Videos-Download-them-now!

From this you can work out how to fire a projectile from an enemy in a straight line.

Comment
Add comment · 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

11 People are following this question.

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

Related Questions

Assets/Scripts/PlayerController.cs(32,49): error CS0126: An object of a type convertible to `float' is required for the return statement 1 Answer

2D Animation does not start 1 Answer

EnemyAi animations, are bugged while moving 0 Answers

Weird pixel displacement in the middle of the screen? 1 Answer

Jumping from a floor to another floor (2D) 2 Answers


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