• 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 giogio_17 · Jul 14, 2014 at 03:32 PM · c#instantiateprefab

How to create new tail in a simple 3D Snake

Hi, I'm new in Unity3D and at the moment I'm realizing a simple Snake 3D.I urgently need a little help about the generation of a new piece of tail when I eat an apple. How do I create a new piece of tail to be taken into at a certain distance from the piece of tail previous? I use this script for generate new tail, but the new tail are generate into the same point.(C#):

 void OnTriggerEnter(Collider other) {
     if ((other.gameObject.tag == "Mela")&&(melaobj == true)) {
         scr = 1;
         Destroy(other.gameObject);
         melaobj = false;
         Codaspam = (GameObject)Instantiate(Coda, new Vector3(target.position.x, target.position.y, target.position.z), Quaternion.identity);
         Codaspam.transform.parent = target.transform;
     }
 }
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

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

How do i Instantiate a prefab with specific assests included 3 Answers

How to associate prefab with a variable in C#? 1 Answer

Only instantiate if clear space beside prefab 1 Answer

How to set a default prefab on a C# script? 1 Answer

The object Player(Clone) must be a prefab in the project view. 1 Answer

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