How to create a robotic construct with a long neck?
Hello!
I've looked into a couple of tutorials and can't find what i'm looking for. Basically i want to create this robotic construct like on the picture with a long neck and a "head" that sits on it. Its already tracking the enemy. Just need to create this "neck" object that connects to the base of the robot and it's head from corresponding ends. Do i need code or is there a built in tool for this?
This might be a very basic but i'm having a real hard time figuring this one out...
This is the code that is used to point at the enemy:
void Update()
{
target = transform.GetComponent<Camera>().ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, transform.position.z));
Vector3 difference = target - player.transform.position;
float rotationZ = Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg;
player.transform.rotation = Quaternion.Euler(0.0f, 0.0f, rotationZ);
if (Input.GetMouseButtonDown(0))
{
float distance = difference.magnitude;
Vector2 direction = difference / distance;
direction.Normalize();
fireBullet(direction, rotationZ);
}
Is there a super easy way to do it? I'm working on 2D template.
howtosnakeneck.jpg
(373.8 kB)
Comment