Created
March 1, 2018 04:02
-
-
Save tsubaki/2509c50d05049863589b066473e9fe78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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