I_wanna_be_a_Fox/Assets/Its_a_trap.cs
Koha9 a80f3d6560 I wanna be a fox first commit.
Initial commit. Complete project for 'I Wanna Be A Fox' - a 2D scrolling game inspired by 'I Wanna Be The Guy'.
2024-02-22 07:27:59 +09:00

20 lines
402 B
C#

using UnityEngine;
using System.Collections;
public class Its_a_trap : MonoBehaviour
{
Player kitsune;
void Start()
{
kitsune = GetComponent<Player>();
}
// ぶつかった瞬間に呼び出される
void OnTriggerEnter2D(Collider2D c)
{
Debug.Log("AHHHHHH!");
GameObject.Find("Player").transform.position = new Vector3(2.0f, 5.0f, 0);
}
}