Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created March 1, 2018 04:02
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 tsubaki/2509c50d05049863589b066473e9fe78 to your computer and use it in GitHub Desktop.
Save tsubaki/2509c50d05049863589b066473e9fe78 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveTo : MonoBehaviour
{
[SerializeField] Transform target;
void Update ()
{
transform.position += Vector3.ClampMagnitude( target.position - transform.position, 0.3f);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spawn : MonoBehaviour
{
[SerializeField] GameObject sceneObject;
void Start()
{
var obj = GameObject.Instantiate(sceneObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment