• 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 Frac7ure · Nov 28, 2012 at 11:03 AM · c#ai

Enemy pick and throw an object

I've spent the last hour trying to find a way to do the above, but I'm having no luck. What I'm trying to do is the following:

The game is a static scene, the player can move and enemies rush to the screen and shoot at him. Much like the old arcade games like house of the dead and Time Crisis. I've got my player being able to shoot at the enemies, and I've enemies that move around and shoot at the player.

What I want now, is to have one type of enemy that will pick up objects that are fired by the player and throw them back. For example, if my player was throw fire a box at an enemy, miss him, then the enemy would pick it up and throw it back.

I'm wanting to know how to go about this and how other people have done it before. Any help with this would be appreciated.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Maulik2208 · Nov 28, 2012 at 11:10 AM

First of all make prefabs of the objects Which are used as projectile and then use vector3.distance to find the distance between the special(Throwing things back)enemy and if it is less(means the shoot by player is missed) then Apply the prfab of the object as a projectile of the special enemy.......Good Luck.....

And IF this Works good for you then don't forget to checkbox of Right answer to be ticked......sorry for the bad english.....Enjoy

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

12 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 avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

is it possible to use navmesh on flying character and target ? 0 Answers

Send an enemy back to its spawn point using waypoints 2 Answers

AI scripting Question. 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges