{"id":5325,"date":"2017-01-24T10:00:48","date_gmt":"2017-01-24T01:00:48","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=5325"},"modified":"2017-02-06T14:51:36","modified_gmt":"2017-02-06T05:51:36","slug":"unity%e3%81%ae%e5%ad%a6%e7%bf%92-part2","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/5325","title":{"rendered":"Unity\u306e\u5b66\u7fd2 part2"},"content":{"rendered":"<p style=\"text-align: center\"><a href=\"\/appnews\/archives\/5281\" target=\"_blank\" rel=\"noopener\">\u524d\u56de<\/a>\u306f\u3001\u7269\u4f53\u306bRigidbody(\u525b\u4f53)\u3092\u4e0e\u3048\u3066\u3001\u7269\u4f53\u306b\u7269\u7406\u30a8\u30f3\u30b8\u30f3\u304c\u4f5c\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f<br \/>\n\u4eca\u56de\u306f\u3001\u30ad\u30fc\u5165\u529b\u3092\u53d6\u5f97\u3057\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306eRigidbody\u3078\u529b\u3092\u52a0\u3048\u3066\u30b2\u30fc\u30e0\u5185\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u3087\u3046<\/p>\n<p><!--more--><\/p>\n<h3>\u4e8b\u524d\u6e96\u5099<\/h3>\n<p>\u524d\u56de\u306e\u30b7\u30fc\u30f3\u306b\u5f15\u304d\u7d9a\u304d\u4f5c\u696d\u3092\u3057\u307e\u3059<\/p>\n<p>\u30dc\u30fc\u30eb\u3092\u52d5\u304b\u3057\u305f\u6642\u306b\u5730\u9762\u3088\u308a\u5916\u3078\u51fa\u3066\u3057\u307e\u308f\u306a\u3044\u3088\u3046\u306b\u58c1\u3092\u4f5c\u6210\u3057\u307e\u3059<br \/>\n\u3053\u308c\u304c\u306a\u3044\u3068\u3001\u58c1\u304b\u3089\u843d\u3061\u305f\u6642\u306b\u5ef6\u3005\u3068\u843d\u4e0b\u3059\u308b\u3060\u3051\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059<\/p>\n<p>\u58c1\u306f\u5730\u9762\u3092\u56f2\u3080\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u306e\u3067\u3001\u5730\u9762\u306e\u30b9\u30b1\u30fc\u30eb\u306b\u5fdc\u3058\u3066\u58c1\u306e\u30b9\u30b1\u30fc\u30eb\u3082\u8a2d\u5b9a\u3057\u307e\u3059<br \/>\n\u79c1\u306e\u5834\u5408\u3001\u30b9\u30b1\u30fc\u30eb\u306f(10.5, 1, 0.5)\u3068\u3057\u3066\u3044\u307e\u3059<br \/>\n<img loading=\"lazy\" class=\"alignnone size-medium wp-image-5326\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/2f5a965cba3376f1971962cb52dad6bc-300x233.png\" alt=\"\u58c1\u751f\u6210\" width=\"600\" height=\"466\" srcset=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/2f5a965cba3376f1971962cb52dad6bc-300x233.png 300w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/2f5a965cba3376f1971962cb52dad6bc.png 1280w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>\u307e\u305f\u3001\u58c1\u3068\u5730\u9762\u304c\u767d\u306e\u307e\u307e\u3067\u306f\u5206\u304b\u308a\u3065\u3089\u3044\u305f\u3081\u306b\u3001Material\u3092\u4f5c\u6210\u3057\u3066\u58c1\u306b\u8272\u3092\u4ed8\u3051\u305f\u3044\u3068\u601d\u3044\u307e\u3059<br \/>\n<img loading=\"lazy\" class=\"alignnone size-medium wp-image-5327\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/b630fc2c6f03e0c49de877e5f067215b-300x233.png\" alt=\"\u8272\u3064\u3052\" width=\"600\" height=\"466\" srcset=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/b630fc2c6f03e0c49de877e5f067215b-300x233.png 300w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/b630fc2c6f03e0c49de877e5f067215b.png 1280w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>1\u3064\u76ee\u306e\u58c1\u304c\u751f\u6210\u3067\u304d\u305f\u3089\u3001\u3053\u308c\u3092\u8907\u88fd\u3057\u3066\u3044\u304d\u307e\u3059<br \/>\n\u65b9\u6cd5\u306f\u3001\u58c1\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af &gt; Duplicate\u304b\u3001\u58c1\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u9078\u629e\u3057\u3066Edit &gt; Duplicate\u3067\u8907\u88fd\u3067\u304d\u307e\u3059<br \/>\n4\u3064\u306e\u58c1\u304c\u751f\u6210\u3067\u304d\u305f\u3089\u305d\u308c\u305e\u308c\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306ePosition\u3092\u5909\u66f4\u3057\u3066\u56db\u65b9\u306b\u914d\u7f6e\u3057\u307e\u3059<br \/>\n<img loading=\"lazy\" class=\"alignnone size-medium wp-image-5329\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/e6315994a2e247016b7f2a6615fab1a3-300x233.png\" alt=\"\u58c1\u3092\u307e\u3068\u3081\u308b\" width=\"600\" height=\"466\" srcset=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/e6315994a2e247016b7f2a6615fab1a3-300x233.png 300w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/e6315994a2e247016b7f2a6615fab1a3.png 1280w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4f5c\u6210<\/h3>\n<p>\u7403\u4f53\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u52d5\u304b\u3059\u305f\u3081\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059<br \/>\n\u307e\u305a\u306f\u3001\u7403\u4f53\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089Add Component &gt; new Script\u3067\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u306a\u3093\u3067\u3082\u3044\u3044\u306e\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u307e\u3059<br \/>\nAssets\u306e\u76f4\u4e0b\u306b\u4f5c\u6210\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3084Open\u306a\u3069\u3067\u30a8\u30c7\u30a3\u30bf\u3092\u8d77\u52d5\u3057\u307e\u3059<\/p>\n<p>\u30ad\u30fc\u5165\u529b\u306e\u53d7\u3051\u53d6\u308a\u306f\u3001Input\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u307e\u3059<br \/>\n\u305d\u306e\u4e2d\u306e\u3069\u306e\u30e1\u30bd\u30c3\u30c9\u304b\u3068\u8a00\u3046\u3068<a href=\"https:\/\/docs.unity3d.com\/jp\/current\/ScriptReference\/Input.html\" target=\"_blank\" rel=\"noopener\">\u516c\u5f0f<\/a>\u306b<strong>\u300c\u5165\u529b\u306b\u3088\u3063\u3066\u3082\u306e\u3092\u52d5\u304b\u3059\u3088\u3046\u306b\u3057\u305f\u3044\u306e\u3067\u3042\u308c\u3070 Input.GetAxis \u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d<\/strong>\u3068\u3042\u308b\u306e\u3067\u3001GetAxis\u3092\u4f7f\u3044\u307e\u3059<\/p>\n<p>\u307e\u305f\u3001<strong>\u300c\u5165\u529b\u30d5\u30e9\u30b0\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u306a\u3044\u306e\u3067\u3001Update \u95a2\u6570\u306e\u4e2d\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u300d<\/strong>\u3068\u3082\u3042\u308b\u306e\u3067\u5f93\u3044\u307e\u3059<\/p>\n<p>\u3053\u308c\u3092\u8e0f\u307e\u3048\u305f\u4e0a\u3067\u8a18\u8ff0\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 1px;padding-left: 5px\"><code>using UnityEngine;\r\n\r\npublic class BallController : MonoBehaviour {\r\n\r\n    private void Update()\r\n    {\r\n        float horizon = Input.GetAxis(\"Horizontal\");\r\n        float vertical = Input.GetAxis(\"Vertical\");\r\n    }\r\n\r\n}\r\n<\/code><\/pre>\n<p>GetAxis(&#8220;Horizontal&#8221;)\u306f\u77e2\u5370\u30ad\u30fc\u306e\u5de6\u53f3\u3001A\u3001D\u306e\u5165\u529b\u5024\u3092-1\u304b\u30891\u3067\u53d6\u5f97\u3057\u307e\u3059<br \/>\nGetAxis(&#8220;Vertical&#8221;)\u306f\u77e2\u5370\u30ad\u30fc\u306e\u4e0a\u4e0b\u3001S\u3001W\u306e\u5165\u529b\u5024\u3092-1\u304b\u30891\u3067\u53d6\u5f97\u3057\u307e\u3059<br \/>\n\u307e\u305f\u3001\u4eca\u56de\u306f\u95a2\u4fc2\u3042\u308a\u307e\u305b\u3093\u304c\u30b8\u30e7\u30a4\u30b9\u30c6\u30a3\u30c3\u30af\u3082\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u3066\u3044\u307e\u3059<br \/>\n\u65b0\u305f\u306b\u8ffd\u52a0\u306a\u3069\u3057\u305f\u5834\u5408\u306b\u306f\u3001Input Manager\u3067\u51fa\u6765\u307e\u3059<\/p>\n<p>\u3053\u306e\u53d6\u5f97\u3057\u305f\u5024\u3092Rigidbody\u306b\u52a0\u3048\u305f\u3044\u306e\u3067Rididbody\u3092GetComponent&lt;&gt;()\u3067\u53d6\u5f97\u3057\u3001\u529b\u3092AddForce()\u3067\u52a0\u3048\u308b\u3053\u3068\u3092\u8ffd\u8a18\u3057\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 1px;padding-left: 5px\"><code>using UnityEngine;\r\n\r\npublic class BallController : MonoBehaviour {\r\n\r\n    private Rigidbody rb;\r\n\r\n    private void Start()\r\n    {\r\n        rb = GetComponent();\r\n    }\r\n\r\n    private void Update()\r\n    {\r\n        float horizon = Input.GetAxis(\"Horizontal\");\r\n        float vertical = Input.GetAxis(\"Vertical\");\r\n\r\n        Vector3 move = new Vector3(horizon, 0, vertical);\r\n\r\n        rb.AddForce(move);\r\n    }\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0a\u3067\u3001\u7403\u4f53\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u529b\u3092\u52a0\u3048\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f<br \/>\n\u5b9f\u969b\u306b\u30d7\u30ec\u30a4\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044<br \/>\n<img loading=\"lazy\" class=\"alignnone size-full wp-image-5339\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/moveBall.gif\" alt=\"moveBall\" width=\"693\" height=\"405\" srcset=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/moveBall.gif 693w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/01\/moveBall-300x175.gif 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/p>\n<h3>\u7d42\u308f\u308a\u306b<\/h3>\n<p>Unity\u306e\u3053\u3068\u3092\u52c9\u5f37\u3057\u3066\u3044\u308b\u3068\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3060\u3051\u3067\u306f\u3001\u7269\u8db3\u308a\u306a\u3044\u3053\u3068\u306b\u6c17\u3065\u304d\u307e\u3057\u305f<br \/>\n\u4f8b\u3048\u3070\u3001\u66f2\u7dda\u3092\u63cf\u304f\u58c1\u306a\u3069\u304c\u306a\u3044\u3053\u3068\u3084\u3001\u597d\u304d\u306a\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u52d5\u304b\u3057\u305f\u3044\u304b\u3089\u3067\u3059<\/p>\n<p>Asset\u30b9\u30c8\u30a2\u306a\u3069\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u306e\u304c\u4e00\u756a\u65e9\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3084\u306f\u308a\u81ea\u5206\u3067\u4f5c\u308c\u305f\u3089\u4e00\u756a\u3067\u3059\u306e\u3067\u3001\u305d\u306e\u8fba\u308a\u306b\u3064\u3044\u3066\u3082\u5b66\u7fd2\u3057\u3066\u3044\u3051\u305f\u3089\u3044\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059<\/p>\n<p>\u706b\u66dc\u65e5\u62c5\u5f53\uff1apoppy<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5325\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/5325\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"Unity\u306e\u5b66\u7fd2 part2\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5325\" data-text=\"Unity\u306e\u5b66\u7fd2 part2\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5325\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5325\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306f\u3001\u7269\u4f53\u306bRigidbody(\u525b\u4f53)\u3092\u4e0e\u3048\u3066\u3001\u7269\u4f53\u306b\u7269\u7406\u30a8\u30f3\u30b8\u30f3\u304c\u4f5c\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f \u4eca\u56de\u306f\u3001\u30ad\u30fc\u5165\u529b\u3092\u53d6\u5f97\u3057\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306eRigidbody\u3078\u529b\u3092\u52a0\u3048\u3066\u30b2\u30fc\u30e0\u5185\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u3087\u3046<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100,109],"tags":[56,108],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5325"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=5325"}],"version-history":[{"count":14,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5325\/revisions"}],"predecessor-version":[{"id":5401,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5325\/revisions\/5401"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=5325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=5325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=5325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}