- Home /
Extend only a part of an object unity
I want to make an enemy that comes into play when stretching the "tentacles" to touch the wall with everyone. If you then hit one of these tentacle disappears and if you hit one more time it disappears another and so on.
This is a picture of how it should be the enemy
If you use transform.Scale.x += scaleAmmount does not work because it extends from both sides.
For destroy one "tentacle" at a time I suppose that is not difficult, once attacked the four "tentacles" enough to destroy one at a time at each collision.
Do you have any advice for me?
IS you enemy a rigged model? if so i suggest separating the tentacle from the body(as different objects) but still have them rigged, the bones in the tentacle will do the stressing when you move them.
Answer by Catlard · May 30, 2014 at 09:05 AM
When you want to make a pivot point for an object in unity, you've got to make sure you do four things:
1) Create an empty parent object, and put it where you want to pivot the object (one of your tentacles). The empty parent object should (at first) have a scale of Vector3.one. You can vertex snap, to get the empty parent object exactly how you want it next to the object you will pivot, using the instructions for vertex snapping on this page: http://docs.unity3d.com/412/Documentation/Manual/PositioningGameObjects.html
2) Make your empty parent object the parent of the object you will pivot (in your case, the tentacle arm).
3) Now, when you scale the parent object to something other than Vector3.one, it will cause whatever mesh or picture the child object is using to scale out from the pivot.
4) Make sure that the Gizmo Display Toggle for Global/Local is set so that the pivot point appears not in the center of the object, but where you want it to pivot from.
Does that help?
Your answer
Follow this Question
Related Questions
How to make my enemies spawn at spawn point, but not randomly? 1 Answer
Distribute terrain in zones 3 Answers
Switch() problem [C#] 1 Answer
Lerp in Coroutine (Crazy Behavior) 2 Answers
Desync between host and client. 0 Answers