ã¹ããŒãž1ïŒã³ã³ã»ãã
ååãšããŠãåå¿è ã®éçºè ã¯ããã®æ®µéã§ãã§ã«æåã®æãéèŠãªã¬ãŒããèžãã§ããŸãããªããªããäœããäœæããåã«ãèªåã®èœåãè©äŸ¡ããã®ãããããã§ãã èªåããŠã¿ãŠãã ãããAAAã¯ã©ã¹ãããžã§ã¯ããäœæããããã®åŒ·ããæéãã¹ãã«ã¯ãããŸããïŒ çãã¯ããŒã§ãïŒ ãã®ã¢ã€ãã¢ãé·ãç®±ã«å ¥ããŠãããããã®æåãããããžã§ã¯ãã®å°çãå®è£ ãããŸã§ãããã«æ»ã£ãŠã¯ãããŸããã ã¡ãªã¿ã«ã幞éãªããšã«ãã€ã³ã¹ããŒã«æ°ã¯50äžããã§ã5段éè©äŸ¡ã§3.5ãè¶ ããåæ¥çã«æåããŠããŸãã æå§ãã«ããã£ãšç°¡åã«èããŠã¿ãŸãããããæåããããããžã§ã¯ãã«å¿ èŠãªãã¹ãŠã®åºæºãçµã¿åããããäžæ¯æ§ã®ããã²ãŒã ã¹ã¿ã€ã«ã®ã¢ãŒã±ãŒããªã©ã®ãããµãããããžã§ã¯ãã§ãã
äžæ¯æ§ã®ã²ãŒã ã¹ã¿ã€ã«ã®å©ç¹ïŒ
- äžæ¯æ§ã®ãã¹ãã£ãããŒãã²ãŒã ãã¬ã€ã
- ããããã®æ¬ åŠ;
- æå°éã®ãã¬ã€ã€ãŒã¢ã¯ã·ã§ã³ãå¿ èŠãšããã·ã³ãã«ã§çŽæçãªã³ã³ãããŒã«ã
- ã°ã©ãã£ãã¯ã¹ã®æå°èŠä»¶ã
æéã®å€§éšåã¯ã³ãŒãã®èšè¿°ã§ã¯ãªããã²ãŒã ã®èŠèŠçã³ã³ããŒãã³ãã®ç 磚ã«è²»ãããããããæåŸã®ç¹ã¯éç«ã£ãŠããŸããããã¯ããã®å Žåã¯ç¹å¥ãªåœ¹å²ãæãããŸããã äžèšãèãããšãç§ã¯3Dã©ã³ããŒãã€ãŸãæåãªZIGZAGã²ãŒã ãšãã圢ã®èšäºã«ãšã©ãŸãããšã«ããŸããã
ã¹ããŒãž2ïŒã¹ã±ãã
ããã§ãç§ãã¡ã¯æãéèŠãªéçºæ®µéã«æ¥ãŸããããããŠãæ®å¿µãªç¬é¡ã¯ããªãã®é¡ãæ®ããŠããŸããããã¹ã±ããã補åã®ããžã§ã³ã§ããããšãæãåºãããŠãã ããã ãããäœæããããšã«ãããããªãã¯å®éã«å°æ¥ã®ã²ãŒã ã®æè¡çãªã¿ã¹ã¯ãæ¿èªããŸããããã«ããããã¹ãŠã®ãããªãã·ã£ãŒãããºã ãšãã³ã¹ããã®ã¿ã¹ã¯ããããããããŸãã ã¹ã±ããã®ç²Ÿç·»åã®çšåºŠã¯ãããªã次第ã§ãã æçµçã«ã¯ãã¢ãŒãã®ã£ã©ãªãŒã§ã¯ãªããèªåã§ãã®ã¹ã±ãããäœæããŸãã ãã®æ®µéã§ãç§ã¯ãã³ãšããŒããæã«åãããã®åŸç°¡åã«ã³ã¡ã³ããšèª¬æãæ®ããŠæãå§ããŸãã
ãã®ã¹ã±ããããããã®ã²ãŒã ã¯ã¢ãã€ã«ãã©ãããã©ãŒã åãã«èšèšãããŠãããããŒãã¬ãŒãã¢ãŒãã§èµ·åãããããšãããããŸãã ã²ãŒã ãã¬ã€ãæŽç·ŽãããŠããŸããããã¬ãŒã€ãŒã®ä»äºã¯ãã²ãŒã ãæäŸããè»ã®å±éºãªã«ãŒããå æããéäžã§ã¯ãªã¹ã¿ã«ãåéããããšã§ãã åéãããã¯ãªã¹ã¿ã«ãšæåããã¿ãŒã³ããšã«ããã¬ã€ã€ãŒã¯ããŒãã¹ãã€ã³ãã®åœ¢ã§å ±é ¬ãåãåããŸãã ç»é¢ãã¿ãããããšãX軞ãšZ軞ã«æ²¿ã£ãŠè»ã®æ¹åã匷å¶çã«å€æŽã§ããŸãã
ã¹ããŒãž3ïŒãããã¿ã€ãäœæ
詳现ãªè¡åèšç»ãæå ã«çœ®ããŠããã°ãå°æ¥ã®ã²ãŒã ã®ãã¢ãŒã·ã§ã³ãã£ããã£ããŸãã¯ãããã¿ã€ãã®äœæã«å®å šã«é²ãããšãã§ããŸãã å®éããã®æ®µéã¯Unityã§ã®äœæ¥ã®å§ãŸãã§ãããç°å¢èšå®ããå§ããå¿ èŠããããŸãã èšå®æ¹æ³ã¯æ¬¡ã®ãšããã§ãã
ç»é¢ã®å·ŠåŽã«ã¯ãã·ãŒã³ãšã²ãŒã ã®ãšãã£ã¿ãŒããããŸãã åŸè ã¯ãããã€ã¹äžã§ã²ãŒã ãã©ã®ããã«èŠããããæ£ç¢ºã«è¡šç€ºããŸãã å³åŽïŒ[éå±€]ããã«ãš[ã€ã³ã¹ãã¯ã¿ãŒ]ããã«ãããã³[ãããžã§ã¯ã]ããã«ãš[ã³ã³ãœãŒã«]ããã«ã®ããäžã
ã¹ããŒãž3.1ïŒãã³ãããã®äž
泚æïŒ ä»¥äžã§ã¯ãåå¿è åãã«èšèšãããæãåçŽãªã²ãŒã å®è£ ã³ãŒãã«ã€ããŠèª¬æããUnityã§ã©ãã ãè¿ éãã€ç°¡åã«çµæãéæã§ãããã瀺ããŸãã ã²ãŒã ã®æçµã³ãŒãã¯ãããŒã¿ã¹ãã¬ãŒãžããããžã§ã¯ãã®æé©åããã³åçåã®åé¡ãå«ãèšèªã®ããæ·±ãç¥èã«åºã¥ããŠå®è£ ãããŸãããæãããªçç±ã«ããããã®èšäºã§ã¯ãããã«ã€ããŠã¯èª¬æããŸããã ãã¹ãŠã®ã¹ã¯ãªãããCïŒã§èšè¿°ããŸãããèå³ã®ãªã人ã®ããã«ãå®å šã«ã¹ããŒãž4ïŒããžã¥ã¢ã«ãã¶ã€ã³ã«é²ãããšãææ¡ããŸãã
ç§ã®ãããã¿ã€ãã³ã°ã¯åžžã«ãã£ã¹ã¯ããå§ãŸããŸããã€ãŸãã俳åªãšããŠãç§ã¯åžžã«ç«æ¹äœãçäœã®ãããªåå§çãªèŠçŽ ã䜿çšããŸãã ãã®ã¢ãããŒãã«ãããéçºããã»ã¹ãå€§å¹ ã«ç°¡çŽ åãããã²ãŒã ã®ä»çµã¿ã«é¢ä¿ããªããã¹ãŠã®ãã®ããæœè±¡åããããšãã§ããŸãã æåã®ã¹ãããã§ã¯ãå°æ¥ã®ã²ãŒã ã®å€èŠ³ã«é¢ããåºæ¬çãªç解ã圢æããŸããèšç»éããã²ãŒã ã¯ã¢ã€ãœã¡ã¹ã¿ã€ã«ã§äœæããããããæåã«è¡ãå¿ èŠãããã®ã¯ã«ã¡ã©ã®ã»ããã¢ããã§ãã ããã§ãUnityã®äž»èŠãªæ©èœã®1ã€ã«é²ã¿ãŸãã å®éã«ã¯ãå¿ èŠãªå€ãéžæããŠãã«ã¡ã©ã®èšå®ãé·æéè©ŠããŠã¿ãããšãã§ããŸã...ããããViewããã«ã䜿çšããŠå¥œã¿ã®ãã¥ãŒãèšå®ããGameObject-> Align With Viewãæå¹ã«ãããšãã«ã¡ã©ã¯ããã«å¿ èŠãªå€ãååŸããŸãã Unityã®äœæè ããã®ãã®ãããªã·ã§ãŒãã«ããã¯æ¬¡ã®ãšããã§ãã
ã·ãŒã³ã®æºåã¯ã§ããŠããŸããããã£ã©ã¯ã¿ãŒã«åããäžããæ¹æ³ã¯ïŒ ãŸããRigidbodyãæ°ããäœæããsphereBehaviorã¹ã¯ãªãããªã©ã®ã³ã³ããŒãã³ããè¿œå ããŠãSphereãªããžã§ã¯ãã®æäœãè¡ããŸãã Use Gravityãã§ãã¯ããã¯ã¹ããªãã«ããããšãå¿ããªãã§ãã ããããã®æ®µéã§ã¯å¿ èŠãããŸããã
ã€ãŸããRigidbodyã³ã³ããŒãã³ãã䜿çšãããšããªããžã§ã¯ãã¯ã質éãéåãéåãå é床ãªã©ãç©çäžçã®ãã¹ãŠã®é åãæããããšãã§ããŸãã ãããç§ãã¡ã«ãšã£ãŠãšãŠãéèŠãªçç±ã§ãïŒ ãããŠä»ãäœãå¿ èŠãªæ¹åã«åããããã«ãé床ãã©ã¡ãŒã¿ãŒããããã«å€æŽããå¿ èŠããããŸãããã³ãŒãã§ãããè¡ããŸãã çäœãX軞ã«æ²¿ã£ãŠç§»åãããŸãããããã®ãããsphereBehaviorã¹ã¯ãªããã«å€æŽãå ããŸãã
using UnityEngine; using System.Collections; public class sphereBehavior : MonoBehaviour { private Rigidbody rb; // Rigidbody private float speed = 5f; // void Start() { rb = GetComponent<Rigidbody> (); // Rigidbody } void Update() { rb.velocity = new Vector3 (speed, 0f,0f); } }
Unityã§ã¯ãããã£ã¯ãxãyãz軞ã«æ²¿ã£ãŠå€ãä¿åããç¹å¥ãªãã¯ãã«ãä»ããŠãäœçœ®ãšæ¹åãèšè¿°ããŸãã ãããã®å€ãå€æŽããããšã«ãããå¿ èŠãªç¹å®ã®èº«äœã®æ¹åãŸãã¯äœçœ®ãå®çŸããŸãã rb.velocity = new Vector3ïŒspeedã0fã0fïŒã®è¡ã¯ãX軞ã«æ²¿ã£ãŠããã£ã«æ°ããæ¹åãèšå®ããããã«ããçäœã«å¿ èŠãªæ¹åãäžããŸãã
ããªããç§ã®ããã«ãã¹ãŠããã£ãå Žåãããªãã®çäœã¯X軞ã«æ²¿ã£ãŠã¹ããŒãã¹ããŒãã§ç¡éã®æ ã«åºãŸãã
ZIGZAGã²ãŒã ã§å®è£ ãããŠããããã«ãããŠã¹ã®å·Šãã¿ã³ã1åã¯ãªãã¯ãããã³ã«ãçäœã®æ¹åãå€æŽããŠã¿ãŸãããã ãããè¡ãã«ã¯ãåã³sphereBehaviorã³ãŒãã«æ»ãã次ã®ããã«å€æŽããŸãã
using UnityEngine; using System.Collections; public class sphereBehavior : MonoBehaviour { private Rigidbody rb; // Rigidbody private bool isMovingRight = true; // , private float speed = 5f; // void Start() { rb = GetComponent<Rigidbody> (); // Rigidbody } void changeDirection() { if (isMovingRight) { isMovingRight = false; } else { isMovingRight = true; } } void Update() { if(Input.GetMouseButtonDown(0)) { changeDirection(); } if (isMovingRight) { rb.velocity = new Vector3 (speed, 0f, 0f); } else { rb.velocity = new Vector3 (0f, 0f, speed); } } }
çäœãX軞ã«æ²¿ã£ãŠç§»åãããšãããã®ç§»åã¯ãå³ã移åãšåŒã°ããZ軞ã«æ²¿ã£ãŠãå·Šã移åãšåŒã°ããŸãã ãããã£ãŠãç¹å¥ãªããŒã«å€æ°isMovingRightã䜿çšããŠãäœã®æ¹åãç°¡åã«èšè¿°ããããšãã§ããŸãã
if(Input.GetMouseButtonDown(0)) { changeDirection(); }
ãã®ã³ãŒãã¯ããŠã¹ã®å·Šãã¿ã³ãç£èŠãããã®ãã¿ã³ããŸã æŒãããŠããå ŽåãåçŽãªããžãã¯ã§changeDirectionïŒïŒé¢æ°ãéå§ããŸãïŒããŠã¹ã®å·Šãã¿ã³ãæŒããããšãã«å€æ°isMovingRightãtrueã ã£ãå Žåãä»ã¯falseã«ãªããŸãã ããŒã«å€æ°ã䜿çšãããšã1ã€ã®ç°¡åãªè³ªåã«çããããšãã§ããŸããããã£ãX軞ã«æ²¿ã£ãŠç§»åãããšããã¹ããŒãã¡ã³ãã¯æ¬åœã§ããïŒ ã€ãŸããããŠã¹ã®å·Šãã¿ã³ãæŒããšãisMovingRightã®å€ãåžžã«å€åãã次ã«trueïŒããã£ãå³ã«ç§»åïŒã次ã«falseïŒããã£ãå·Šã«ç§»åïŒã«ãªããŸãã
ãŸãã¯ã changeDirectionïŒïŒé¢æ°ã1è¡ã§èšè¿°ã§ããŸãã
void changeDirection() { isMovingRight = !isMovingRight; }
æåŸã«è¡ãå¿ èŠãããã®ã¯ãå€æ°isMovingRightãèæ ®ããŠç§»åæ¹æ³ã®æ¹åãæžãæããããšã§ãã
if (isMovingRight) { rb.velocity = new Vector3 (speed, 0f, 0f); } else { rb.velocity = new Vector3 (0f, 0f, speed); }
isMovingRightãtrueã®å ŽåïŒçäœãå®éã«å³ã«ç§»åããå ŽåïŒãé床ã¯æ°ããæ¹åãã¯ãã«ãåããŸãrb.velocity = new Vector3ïŒspeedã0fã0fïŒ; isMovingRightãfalseã®å Žåãããã£ã¯å³ã«ç§»åããªããªããŸããã€ãŸããæ¹åãã¯ãã«ãrb.velocity = new Vector3ïŒ0fã0fãspeedïŒã«å€æŽããæéã§ãã
ã²ãŒã ãèµ·åããããŠã¹ãæ°åã¯ãªãã¯ãããšãç§ã®ããã«ãã¹ãŠãå®è¡ããå Žåãçäœããžã°ã¶ã°ãæãå§ããæ§åãããããŸãã
ãã£ããã ãã¡ããéããŸãïŒ çµå±ãçã¯åããŠããŠãç§ãã¡ã¯ãã£ãšç«ã£ãŠããŸãã ã²ãŒã ãä¿®æ£ããŠãçäœã«æ²¿ã£ãŠåããçäœãèŠå€±ãããšããªãããã«ããŸãã ãããè¡ãã«ã¯ãcameraFollowã¹ã¯ãªãããäœæããã¡ã€ã³ã«ã¡ã©ãªããžã§ã¯ãã«ã¢ã¿ããããå¿ èŠããããŸãã
次ã«ãcameraFollowã¹ã¯ãªããã³ãŒãã瀺ããŸãã
using UnityEngine; using System.Collections; public class cameraFollow : MonoBehaviour { public GameObject player; public Vector3 offset; void Start () { offset = transform.position - player.transform.position; } void Update () { transform.position = player.transform.position + offset; } }
ãªããžã§ã¯ãã远跡ããæ¹æ³ã¯ïŒ ãŸããCameraãªããžã§ã¯ããšSphereãªããžã§ã¯ãã®ãªãã»ããã®å·®ãèšç®ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãçã®åº§æšãã«ã¡ã©äœçœ®ããæžç®ããçµæã®å·®ããªãã»ããå€æ°ã«ä¿åããã ãã§ååã§ãã ãã ããæåã«ãçäœã®åº§æšã«ã¢ã¯ã»ã¹ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ããã¬ãŒã€ãŒå€æ°ãå¿ èŠã§ããããã¯åçŽãªGameObjectã§ãã çäœã¯åžžã«åããŠãããããã«ã¡ã©åº§æšãçäœã®åº§æšãšåæããã以åã«ååŸãããªãã»ãããè¿œå ããå¿ èŠããããŸãã ãã¬ãŒã€ãŒãã£ãŒã«ãã§è¿œè·¡ãªããžã§ã¯ãã瀺ãããã ãã«æ®ããå®å šã«çµæãè³è³ããããšãã§ããŸãã å³ã«ç€ºãããã«ãSphereãªããžã§ã¯ããcameraFollowã¹ã¯ãªããã®Playerãã£ãŒã«ãã«ãã©ãã°ããã ãã§ãïŒã¡ã€ã³ã«ã¡ã©ã¯åæã«éžæãããŸãŸã«ããå¿ èŠããããŸãïŒã
ä»ãç§ãã¡ã®çã空äžãæåéã空äžã«æµ®ããŠããã®ã§ãç§ãã¡ã®çãããã«æ²¿ã£ãŠåãããšãã§ããéè·¯ã®çæã«ã€ããŠèããŠã¿ãŸãããã Cubeãªããžã§ã¯ããã«ã¹ã¿ãã€ãºããããšããå§ããŸããããããã¯ãç§ãã¡ã®æèŠã§ã¯ããã¹ã®ã»ã¯ã·ã§ã³ãè¡šããŸãã
ãªã¹ãã«ã°ã©ãŠã³ãã¿ã°ããªãå Žåã¯ã[ã¿ã°ã®è¿œå ...]ã¿ãã§äœæããå¿ èŠããããŸãã
次ã«è¡ãå¿ èŠãããã®ã¯ããããžã§ã¯ãã®ã«ãŒãã«Prefabsãšããç¹å¥ãªãã©ã«ããŒãäœæããã€ã³ã¹ãã¯ã¿ãŒããçŽæ¥ãã¥ãŒãããã©ãã°ããããšã§ãã ãã®åŸãCubeãªããžã§ã¯ãã®ååãéã«å€ãã£ããããã¹ãŠãæ£ããè¡ããŸããã
ãã¬ããã¯ãGameObjectãšãã®ãã¹ãŠã®å€ãšããããã£ã1ãæã«ä¿åã§ããç¹å¥ãªã¿ã€ãã®ãªããžã§ã¯ãã§ãã ãã¬ããã䜿çšãããšãç¡éã®æ°ã®ãªããžã§ã¯ããäœæã§ãããã®å€æŽã¯ãã¹ãŠã®ã³ããŒã«çŽã¡ã«åœ±é¿ããŸãã ã€ãŸããPrefabsãã©ã«ããŒããå¿ èŠãªåæ°ã ãCubeãã¹ãåŒã³åºãããšãã§ããããã«ãªããŸããã
ããã§ã空ã®GameObjectãäœæãïŒéå±€ãå³ã¯ãªãã¯ããŠïŒãååãRoadContainerã«å€æŽããäœæããã°ããã®roadBehaviorã¹ã¯ãªãããããã«è¿œå ããŸãã
ãããŠããããroadBehaviorã³ãŒããã®ãã®ã§ãã
using UnityEngine; using System.Collections; public class roadBehavior : MonoBehaviour { public GameObject road; // private Vector3 lastpos = new Vector3 (0f,0f,0f); // void Start() { for(int i=0; i<10; i++) { GameObject _platform = Instantiate (road) as GameObject; _platform.transform.position = lastpos + new Vector3 (1f,0f,0f); lastpos = _platform.transform.position; } } }
ããã§å®éã«äœãèµ·ãã£ãŠããã®ã§ããïŒ ã芧ã®ããã«ãåŸã§Cubeãã¬ããã«æåã§ãã€ã³ããããå€æ°ããããæåŸã®ãã¬ããã»ããã®åº§æšãæ ŒçŽããVector3ãªããžã§ã¯ãããããŸãïŒçŸåšå€ã¯ãŒãã§ãïŒã
for(int i=0; i<10; i++) { GameObject _platform = Instantiate (road) as GameObject; _platform.transform.position = lastpos + new Vector3 (1f,0f,0f); lastpos = _platform.transform.position; }
ãã®ã³ãŒãã»ã¯ã·ã§ã³ã¯æ¬¡ãå®è¡ããŸããi<10ã§ããéãããã¬ãããååŸããæåŸã®äœçœ®ãèæ ®ããŠãã®äœçœ®ãèšå®ããŸãlastpos + Xã«æ²¿ã£ããªãã»ãããèæ ®ããäœçœ®ãæåŸã®äœçœ®ãä¿æããŸãã ã€ãŸããçµæãšããŠã10åã®Cubeãã¬ããã次ã ãšæ£ç¢ºã«ã€ã³ã¹ããŒã«ãããŸãã ãã§ãã¯ããåã«ãCubeãªããžã§ã¯ããPrefabsãã©ã«ããŒããroadå€æ°ã«å²ãåœãŠãããšãå¿ããªãã§ãã ããã
ããããŸãããã次ã«äœãããŸããïŒ ãããŠããããã¯ãã©ã³ãã ãªé åºã§ã€ã³ã¹ããŒã«ãç¶ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãã©ã³ãã ãªæ¬äŒŒä¹±æ°ãžã§ãã¬ãŒã¿ãå¿ èŠã§ãã ã€ãããŒã·ã§ã³ãèæ ®ããŠãroadBehaviorã¹ã¯ãªãããä¿®æ£ããŸãã
using UnityEngine; using System.Collections; public class roadBehavior : MonoBehaviour { public GameObject road; // private Vector3 lastpos = new Vector3 (0f,0f,0f); // void Start() { for(int i=0; i<10; i++) { GameObject _platform = Instantiate (road) as GameObject; _platform.transform.position = lastpos + new Vector3 (1f,0f,0f); lastpos = _platform.transform.position; } InvokeRepeating ("SpawnPlatform", 1f, 0.2f); } void SpawnPlatform() { int random = Random.Range (0, 2); if (random == 0) { // X GameObject _platform = Instantiate (road) as GameObject; _platform.transform.position = lastpos + new Vector3 (1f,0f,0f); lastpos = _platform.transform.position; } else { // Z GameObject _platform = Instantiate (road) as GameObject; _platform.transform.position = lastpos + new Vector3 (0f,0f,1f); lastpos = _platform.transform.position; } } }
è¡InvokeRepeatingïŒ "SpawnPlatform"ã1fã0.2fïŒã¯ ãã²ãŒã ã®éå§1ç§åŸã«SpawnPlatformïŒïŒé¢æ°ãã¢ã¯ãã£ãã«ãã0.2ç§ããšã«å床åŒã³åºãããšãç®çãšããŠããŸãã é¢æ°èªäœã«ã€ããŠã¯ã圌ããèšãããã«ããã¹ãŠãèžãã«ããããç°¡åã§ãïŒ 0.2ç§ããšã«ãã·ã¹ãã ã¯0ãã1ãŸã§ã®æ°åã®éã®ä¹±æ°ãäœæããŸããã·ã¹ãã ã0ãæšæž¬ããå ŽåãX軞ã«æ°ãããã¬ãããèšå®ãã1ã®å Žåã¯Z軞ã«èšå®ããŸãã
ãããŠæåŸã«ãçãã³ãŒã¹ãå€ãããã³ã«çãèœäžãããŸãããã ãããè¡ãã«ã¯ãæ°ããplayerFallsã¹ã¯ãªãããäœæãããããSphereãªããžã§ã¯ãã«æ·»ä»ããŸãã
次ã«ãplayerFallsã¹ã¯ãªããã³ãŒãèªäœã瀺ããŸãã
using UnityEngine; using System.Collections; public class playerFalls : MonoBehaviour { private Rigidbody rb; void Start() { rb = GetComponent<Rigidbody> (); } void Update() { RaycastHit hit; if(Physics.Raycast (transform.position, Vector3.down, out hit, 5f) && hit.transform.gameObject.tag == "Ground") { rb.useGravity = false; } else { rb.useGravity = true; } } }
ã¬ã€ãã£ã¹ã-ã¬ãŒã¶ãŒã«äŒŒãç¹æ®ãªããŒã ã§ãã·ãŒã³ã«åãã£ãŠæŸå°ãããŸãã ããŒã ããªããžã§ã¯ãããåå°ãããå Žåãè¡çªãããªããžã§ã¯ãã«é¢ããæ å ±ãè¿ããŸãã ãããŠãããã¯ãšãŠãã¯ãŒã«ã§ãããªããªããçã®äžå¿ããäžã«åãããããã®ãããªããŒã ã«ãã£ãŠããã¥ãŒããã©ãããã©ãŒã äžã«ãããã©ããããã§ãã¯ããããã§ãïŒãªããžã§ã¯ãã«ã¿ã°ãGroundãããããã©ããããã§ãã¯ããŸãïŒã ãããŠãéè·¯ã®é åãé¢ãããšããã«ãçã®éåãã©ã¡ãŒã¿ãèªåçã«ã¢ã¯ãã£ãã«ããŸãïŒæåã«æå³çã«ãªãã«ããã®ãèŠããŠããŸããïŒïŒããã®åŸãéåã®åœ±é¿äžã§çãã¯ã©ãã·ã¥ããŸããããïŒ
ã¹ããŒãž4ïŒããžã¥ã¢ã«ãã¶ã€ã³
ã²ãŒã ã®ä»çµã¿ã«é¢ãããã¹ãŠã®äœæ¥ãå®äºãããããããžã§ã¯ãã®èŠèŠçãªéšåã«ç§»ããŸãããã ããã§ããã²ãŒã ãã¬ã€ã¯è¯å¥œã§ãããå¿«é©ãªã²ãŒã ãã¬ã€ã¯ããã«åªããŠããŸãã ãããŠãæåã«æãéèŠãªããšããé ããŸã§ã¹ã±ãžã¥ãŒã«ãæŠèª¬ãããšããäºå®ã«ãããããããç§ã¯ãŸã äœæãããŠããã²ãŒã ã«è²ãè¿œå ããããšã«ãã£ãŠããããã®ç±æãè¿œå ããããšæããŸãã çèããåŸã次ã®ã¢ã€ãã¢ãæãæµ®ãã³ãŸããã
èšèšäžãããªãã¯è»ãé転ããŠåºå€§ãªæµ·ãé§ãæããå·®ãè¿«ã£ã倧å€åããéããŸãã ãã©ãããã©ãŒã ã¯çµ¶ãã深海ã«è»¢åããããšåªåãããã¬ã€ã€ãŒãæ¥ãšå€±æã®æ·±byã«åŒããã蟌ããããå 延ã°ãã¯æ»ã«äŒŒãŠããŸãã ããã«ãæã ãã©ãããã©ãŒã ãè²ãå€ãå§ããèªåè»ã¯èªçºçã«é床ãäžããŸãã ãããã¯ãã¹ãŠãã²ãŒã ã«äžçš®ã®ãææŠããããããããã«èšèšãããŠããŸãã èšãããããã«ãæåè£ã«å®äºããã¿ãŒã³ãŸãã¯åéãããã¯ãªã¹ã¿ã«ããšã«ããã¬ã€ã€ãŒã¯çµŠäžã®ããŒã«ã«ãªé¡äŒŒæ§ã§ãããIncamãã§å ±é ¬ãåãåããŸãã ãã®åŸãåºã§é«ããIncamãã®è»ãšçµŠäžã亀æã§ããŸãã ãã®ã³ã³ã»ããã¯ããIncome Racerããšããååãä»ããŸããã
ãã¹ãŠã®ã¢ã»ããã¯ãç¡æã®3Dãšãã£ã¿ãŒã§ããBlenderã§ã¢ãã«åãããŸããã ãã®äžã§ãå¿ èŠãªãã¯ã¹ãã£ãäœæããããã®åŸPhotoshopã§åãå ¥ãå¯èœãªåœ¢åŒã«ãªããŸããã 楜ããç¬éã¯ãUnityãç°¡åã«Blenderãã3Dã¢ãã«ãã€ã³ããŒãããé çã®ãªãããšã§ãäœæããã»ã¹ãå¿«é©ã§çã¿ã®ãªããã®ã«ããŸããã
ã¹ããŒãž5ïŒç 磚
ãããžã§ã¯ãã®éçºã¯ãŸã ãããã§ããäœãæ¹åãããããçŽãããã§ããå Žæãåžžã«ããããã§ãã å€ãã®å Žåãç 磚ãšä»äžãã®æ®µéã§ãéçºããã»ã¹ãæéå ã«å€§å¹ ã«å€±ãããããåæ¢ããããšãããããŸãã ãã®çç±ã¯ããã§ã«ããªãç²ããŠããããã§ããã²ãŒã ã¯å調ã§ãé¢çœããªãããã§ãã æã«ã¯ãéçºã®çµããã«ãã²ãŒã ãæåããäœãçŽããŠå°ãªããšã2åã¯æ¹åã§ãããšããäºå®ãæããã«ãªããŸãïŒ ãããã®èããæšãŠãŠãèšç»ããããã©ã®ããã«å§ãŸã£ãããèããŠãã ããã éçºãç¡æéã«é ããããããããªãªãŒã¹åŸã«ã¢ããããŒããå±éããŠã²ãŒã ãè£å®ããæ¹ãé©åã§ãã ããããªããšããããžã§ã¯ãã«å€§èãªååãä»ããããšã§ãããžã§ã¯ããå°ç¡ãã«ããå±éºããããŸãã ããšãã°ããããã®è¡ãæžããŠããæç¹ã§ã¯ãã²ãŒã ã«ã¯éå§ç»é¢ãããããŸããã§ããã ãã®çç±ã¯ãèšç»ã«åŸã£ãŠãéçºããã»ã¹ã«å²ãåœãŠããã90æéãè¶ ããããšãã§ããªãã£ããšããäºå®ã§ãã ãã¡ããã玹ä»ç»é¢ãäœæããã®ã«ããã«æ°æéãããå¯èœæ§ã¯ãããŸããã圌ã¯åŸãäºå®ããããŸããã ãããŠããªãªãŒã¹åŸã«ã²ãŒã ã«ããã€ãã®ç¬éãè¿œå ãããã®ã¯æ®éã§ãã
æåŸã«ãç°¡åãªèª¬æããããªãã²ãŒã ã¢ã€ã³ã³ãªã©ã®ãã¬ãŒã³ããŒã·ã§ã³ããã¥ã¡ã³ããäœæããŸãã ãŠãŒã¶ãŒããããžã§ã¯ããå€æãå§ããã®ã¯ããŸãã«ã¢ã€ã³ã³ã«ãã£ãŠã§ããããããã®æ®µéã«ã¯ã§ããã ã泚æãæãå¿ èŠããããŸãã
çµå±ãäœãèµ·ãã£ãã®ããå€æããŸããã ãããããã®ã«é¢ãããã¹ãŠã«90æé以äžãè²»ããããŸããããçŸä»£ã®ã²ãŒã éçºè ã®æšæºã§ã¯ããã»ã©å€ãã¯ãããŸããã ãã®æéã®åŸãã²ãŒã ã¯ãã¬ã€ããŒã±ããã«ã¢ããããŒããããæ®éçãªãã©ã€ã¢ã«ããã®ãããªç©èªã«åããããŸããïŒ èšäºãæ°ã«å ¥ã£ãå ŽåããŸãã¯äœã話ãããããšãããã°ãã³ã¡ã³ãããŠãã ããã ã質åã«ãçãã§ããããšãå¬ããæããŸãã