I have a slight issue with my Footprint decals (which are instantiated planes), they don’t seem to Instantiate with the Players rotation in mind; as can be seen in the screenshot, they all face the same direction.
My code is as below, any help would be greatly appreciated.
function ManageFootprints()
{
var _hit:RaycastHit;
var _offset:Vector3 = Vector3(0, 0.1, 0);
if (Physics.Raycast(transform.position, -transform.up, _hit))
{
if (_playerCamera.GetComponent("Camera_Headbob_Controller").waveslice < -0.95 && !_playerFootprintPlaced)
{
var _hitRotation = Quaternion.FromToRotation(Vector3.forward, _hit.normal);
var _newFootprint = Instantiate(_footprintPrefab, _hit.point + _offset, _hitRotation);
_playerFootprintPlaced = true;
Destroy(_newFootprint, 300);
}
if (_playerCamera.GetComponent("Camera_Headbob_Controller").waveslice > 0)
{
_playerFootprintPlaced = false;
}
}
}