{"id":2351,"date":"2020-10-21T22:35:34","date_gmt":"2020-10-21T13:35:34","guid":{"rendered":"https:\/\/obenkyolab.com\/?p=2351"},"modified":"2022-01-08T11:08:16","modified_gmt":"2022-01-08T02:08:16","slug":"%e3%80%90unity%e3%80%91-error-cs0029-cannot-implicitly-convert-type-unityengine-quaternion-to-unityengine-vector3%e3%81%8c%e5%87%ba%e3%81%9f%e6%99%82%e3%81%ae%e5%af%be%e5%87%a6%e6%b3%95","status":"publish","type":"post","link":"https:\/\/obenkyolab.com\/?p=2351","title":{"rendered":"\u3010Unity\u3011 error CS0029: Cannot implicitly convert type &#8216;UnityEngine.Quaternion&#8217; to &#8216;UnityEngine.Vector3&#8217;\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/obenkyolab.com\/?p=2351\/#%E6%A6%82%E8%A6%81\" >\u6982\u8981<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/obenkyolab.com\/?p=2351\/#%E7%92%B0%E5%A2%83\" >\u74b0\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/obenkyolab.com\/?p=2351\/#%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%97%E3%81%9F%E3%82%B3%E3%83%BC%E3%83%89\" >\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u30b3\u30fc\u30c9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/obenkyolab.com\/?p=2351\/#%E5%8E%9F%E5%9B%A0\" >\u539f\u56e0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/obenkyolab.com\/?p=2351\/#%E5%AF%BE%E5%87%A6%E6%B3%95\" >\u5bfe\u51e6\u6cd5<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%A6%82%E8%A6%81\"><\/span>\u6982\u8981<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Unity\u306eC#\u958b\u767a\u306b\u304a\u3044\u3066transform\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u89e6\u3063\u3066\u3044\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u305f\u3081\u3001\u305d\u306e\u5bfe\u51e6\u65b9\u6cd5\u306b\u3064\u3044\u3066\u30e1\u30e2\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nerror CS0029: Cannot implicitly convert type &#039;UnityEngine.Quaternion&#039; to &#039;UnityEngine.Vector3&#039;\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%92%B0%E5%A2%83\"><\/span>\u74b0\u5883<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Windows10<br>Unity 2020.1.f1<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%97%E3%81%9F%E3%82%B3%E3%83%BC%E3%83%89\"><\/span>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u30b3\u30fc\u30c9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic class BulletCon : MonoBehaviour\n{\n    Vector3 LocalPos;\n    Vector3 LocalRot;\n\n    \/\/ Start is called before the first frame update\n    void Start()\n    {\n        LocalPos = this.transform.localPosition;\n        LocalRot = this.transform.localRotation;\n    }\n}\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8E%9F%E5%9B%A0\"><\/span>\u539f\u56e0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>transform.localRotation\u306fVector3\u578b\u306b\u4ee3\u5165\u3067\u304d\u306a\u3044\u306e\u306bVector3\u578b\u306b\u4ee3\u5165\u3057\u3066\u3044\u305f\u3002localRotation\u3067\u306a\u304ftransform.rotation\u306e\u5834\u5408\u3082\u540c\u69d8\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AF%BE%E5%87%A6%E6%B3%95\"><\/span>\u5bfe\u51e6\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Vector3\u578b\u3067\u306f\u306a\u304f<strong>Quaternion<\/strong>\u578b\u3067\u5909\u6570\u3092\u5ba3\u8a00\u3057\u3066localRotation\u3092\u4ee3\u5165\u3057\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; highlight: [4]; title: ; notranslate\" title=\"\">\npublic class BulletCon : MonoBehaviour\n{\n    Vector3 LocalPos;\n    Quaternion LocalRot;\n\n    \/\/ Start is called before the first frame update\n    void Start()\n    {\n        LocalPos = this.transform.localPosition;\n        LocalRot = this.transform.localRotation;\n    }\n}\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p>\u4ee5\u4e0a<\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Unity\u3092\u4e00\u304b\u3089\u5b66\u3076\u306e\u306b\u304a\u3059\u3059\u3081\u306e\u672c\u306f\u30b3\u30c1\u30e9<\/span><\/strong><\/p>\n\n\n\n<iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"https:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?ref=qf_sp_asin_til&amp;t=sebone0f-22&amp;m=amazon&amp;o=9&amp;p=8&amp;l=as1&amp;IS2=1&amp;detail=1&amp;asins=B08CB1RS5V&amp;linkId=18bb2ebedf43ec8b22e41eae43c36cd0&amp;bc1=000000&amp;lt1=_blank&amp;fc1=333333&amp;lc1=0066c0&amp;bg1=ffffff&amp;f=ifr\">\n    <\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 Unity\u306eC#\u958b\u767a\u306b\u304a\u3044\u3066transform\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30b9&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1805,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"https:\/\/obenkyolab.com\/?p=2351","footnotes":""},"categories":[44],"tags":[],"class_list":["post-2351","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-unity","ja"],"_links":{"self":[{"href":"https:\/\/obenkyolab.com\/index.php?rest_route=\/wp\/v2\/posts\/2351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/obenkyolab.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/obenkyolab.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/obenkyolab.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/obenkyolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2351"}],"version-history":[{"count":6,"href":"https:\/\/obenkyolab.com\/index.php?rest_route=\/wp\/v2\/posts\/2351\/revisions"}],"predecessor-version":[{"id":3856,"href":"https:\/\/obenkyolab.com\/index.php?rest_route=\/wp\/v2\/posts\/2351\/revisions\/3856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/obenkyolab.com\/index.php?rest_route=\/wp\/v2\/media\/1805"}],"wp:attachment":[{"href":"https:\/\/obenkyolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/obenkyolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/obenkyolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}