---
tags:
    - "Transform"
---

# Transform Look At

[Transform](../index.md) / [Rotation](index.md) / **Transform Look At** Target, WorldUp

## Description

Rotates the transform so the forward vector points at a target

## Parameters

| Name | Description |
| :--- | :---------- |
| Target |  |
| World Up |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Transform Look At")]
    [Category("Transform/Rotation/Look At", "Target, WorldUp")]
    [Description("Rotates the transform so the forward vector points at a target")]
    
    [Image(typeof(IconEye), ColorTheme.Type.Lime)]
    [Keywords("Transform")]
    
    [Parameter("Target")]
    [Parameter("World Up")]
    
    [Serializable]
    public class GenInstructionTransform_LookAt_2_TransformTarget_Vector3WorldUp : Instruction
    {
        [SerializeField] private GetGameObject m_Transform = new GetGameObject(
            new GenTypeGameObject_Transform()
        );
        
        [SerializeField] private GetGameObject m_Target = new GetGameObject();
        
        [SerializeField] private GetVector3 m_WorldUp = new GetVector3();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Look At");
            return $"{this.m_Transform} {method} ({this.m_Target}, {this.m_WorldUp})";
        }
        
        protected override Awaitable Run(Args args)
        {
            Transform component = this.m_Transform.Get<Transform>(args);
            if (component == null) return Done;
            
            component.LookAt(
                (Transform) this.m_Target.Get<Transform>(args),
                (Vector3) this.m_WorldUp.Get(args)
            );
            
            return Done;
        }
    }
}


```

