Skip to content

Instantly share code, notes, and snippets.

@AlexMeesters
Created June 30, 2019 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexMeesters/1b121ba66e52f009952c82f69f5e3e50 to your computer and use it in GitHub Desktop.
Save AlexMeesters/1b121ba66e52f009952c82f69f5e3e50 to your computer and use it in GitHub Desktop.
using UnityEngine;
public static class TransformExtentions
{
public static void SetX(this Transform transform, float x)
{
transform.position = new Vector3(x, transform.position.y, transform.position.z);
}
public static void SetY(this Transform transform, float y)
{
transform.position = new Vector3(transform.position.x, y, transform.position.z);
}
public static void SetZ(this Transform transform, float z)
{
transform.position = new Vector3(transform.position.x, transform.position.y, z);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment