Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Rotate by Rotation#

Math / Rotate by Rotation

  • Can Read

  • Cannot Write

Description#

Applies a rotation to a vector, turning the direction it points at

Parameters#

Name Description
Vector The vector that is rotated
Rotation The rotation applied to the vector

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Rotate by Rotation")]
    [Category("Math/Rotate by Rotation")]

    [Description("Applies a rotation to a vector, turning the direction it points at")]
    [Image(typeof(IconQuaternion), ColorTheme.Type.Yellow, typeof(BadgeRotation))]

    [Parameter("Vector", "The vector that is rotated")]
    [Parameter("Rotation", "The rotation applied to the vector")]

    [Keywords("Vector", "Quaternion", "Turn", "Spin", "Direction", "Transform", "Multiply")]

    [Serializable]
    public class TypeVector3MathRotateByQuaternion : TypeVector3
    {
        [SerializeField] private GetVector3 m_Vector = new GetVector3();
        [SerializeField] private GetQuaternion m_Rotation = new GetQuaternion();

        public override Vector3 GetPreview(GameObject source)
        {
            return this.m_Rotation.GetPreview(source) * this.m_Vector.GetPreview(source);
        }

        public override Vector3 Get(Args args)
        {
            return this.m_Rotation.Get(args) * this.m_Vector.Get(args);
        }

        public override string ToString()
        {
            return $"{this.m_Rotation} * {this.m_Vector}";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.