- Home /
Question by
unity_Fh_3Ok4CaXlg-w · Jun 20, 2019 at 03:31 AM ·
gameobjectcolliderunity 4
Player constantly jumping. And when player jump on deflected platform next jump will be changed the trajectory by it.
void OnCollisionEnter(Collision col)
{
if (col.gameObject.tag == "Ground")
{
Transform tf = col.gameObject.transform;
print(tf.eulerAngles);
if (tf.eulerAngles.z >= 320 && tf.eulerAngles.z <= 350)
{
rb.velocity = Tools.HpmV0(transform, new Vector3(2, 1.5f, 2), 40);
print("Right");
}
Comment