Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
日本語でスクリプトを書いてみよう
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class 新しい振る舞いのスクリプト : MonoBehaviour {
bool 動いたかどうかのフラグ;
Vector3 フォースは我と共にあり = new Vector3(10f, 10f, 0f);
void Start(){
Debug.Log("新しい振る舞いのスクリプトが呼ばれている");
}
void FixedUpdate(){
if (Time.frameCount < 10){
return;
}
if (!動いたかどうかのフラグ){
gameObject.GetComponent<Rigidbody>().AddForce(フォースは我と共にあり, ForceMode.Impulse);
動いたかどうかのフラグ = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.