Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

A way to instantiate an item with 90 Degree increments?

$
0
0
I am working on a very complex simulation game, I have code most of it myself, However for things you spawn in such as torches, and unsymmetrical items, I need a way that I can instantiate the prefab and rotate it to face me at 90 degree increments. Such as if I were placing a Cabinet, I don't want it to be the inverted Identity, because if I'm offset from the wall, It will be offset too. Thus part of the cabinet would be in the wall. The only axis that I want the objects to rotate around is the Y axis. Thanks in advance! PS. All I need help with is to make the part of the Instantiate(Block, hit.point, ------) The ---- is the rotation part I need help with. I need an equation to put in that will always result in 90 degree increments, to the vector rotation, Im fairly sure some Conversion of Quaternions would be involved or something like that.

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>