<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>atsuhiro-me</author_name>
  <author_url>https://blog.hatena.ne.jp/atsuhiro-me/</author_url>
  <blog_title>みーのぺーじ</blog_title>
  <blog_url>https://pc.atsuhiro-me.net/</blog_url>
  <categories>
    <anon>Unity</anon>
  </categories>
  <description>Unityではtransform.LookAt(target)を使えば指定した方向を向くように向きを設定できますが，2Dのspriteではうまく指定した方向を向いてくれません (Unity 4.5.1で確認)． なので，LookAtを2Dで実装して回避するスクリプトをメモしておきます． # Boo script dv as Vector3 = target.position-transform.position angle as single = Mathf.Atan2(dv.y, dv.x) * Mathf.Rad2Deg transform.rotation.eulerAngles = V…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpc.atsuhiro-me.net%2Fentry%2F2014%2F07%2F13%2F201345&quot; title=&quot;SpriteでLookAtがうまく動作しない時の回避策 - みーのぺーじ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-07-13 20:13:45</published>
  <title>SpriteでLookAtがうまく動作しない時の回避策</title>
  <type>rich</type>
  <url>https://pc.atsuhiro-me.net/entry/2014/07/13/201345</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
