<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>uni-mal</author_name>
  <author_url>https://blog.hatena.ne.jp/uni-mal/</author_url>
  <blog_title>Unityでインディゲームを作る！</blog_title>
  <blog_url>https://indie-game-creation-with-unity.hatenablog.com/</blog_url>
  <categories>
    <anon>UnityのためのC#</anon>
  </categories>
  <description>UnityにおいてColliderが衝突した時に呼び出されるOnCollisionEnterを利用して、ボールが綺麗に跳ね返る、あるいは反射する壁を作ってみました。ここでのボールとはRigidbodyコンポーネントを持ち、物理挙動をするボールのことです。 単純にボールがバウンドするような壁はPhysic Materialでも作れないことは無いと思いますが、今回はそれとは違う、よりゲーム的に都合が良い結果が出せるであろうアプローチを取っていきます。 ボールの向きを反射する シーンにcubeを追加して、スケールを変更し横長の壁を作ります。そしてBallReflectionWallというC#スクリプ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Findie-game-creation-with-unity.hatenablog.com%2Fentry%2Fball-reflection-wall-by-collision&quot; title=&quot;Unity2021.3 | OnCollisionEnterを使ってボールを跳ね返す壁を作る[ relativeVelocity ] - Unityでインディゲームを作る！&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>https://cdn-ak.f.st-hatena.com/images/fotolife/u/uni-mal/20230226/20230226204803.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-02-26 21:04:15</published>
  <title>Unity2021.3 | OnCollisionEnterを使ってボールを跳ね返す壁を作る[ relativeVelocity ]</title>
  <type>rich</type>
  <url>https://indie-game-creation-with-unity.hatenablog.com/entry/ball-reflection-wall-by-collision</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
