mirror of
https://github.com/ConjureETS/PillowFight.git
synced 2026-03-24 00:50:59 +00:00
Began the pillow swinging action
Signed-off-by: RosimInc <rosim_inc@hotmail.com>
This commit is contained in:
parent
eff22d0d6b
commit
2ee831b878
@ -223,7 +223,23 @@ public class Child : MonoBehaviour
|
|||||||
|
|
||||||
pillow = null;
|
pillow = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Swing()
|
||||||
|
{
|
||||||
|
//1. Determine if there is someone in front
|
||||||
|
Transform t = null; //GetTarget
|
||||||
|
|
||||||
|
if(t == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//2. Apply force to the person
|
||||||
|
Vector3 direction = target.transform.position - transform.position;
|
||||||
|
|
||||||
|
direction = direction.normalized;
|
||||||
|
|
||||||
|
t.gameObject.GetComponent<Child>().Push(direction * ThrowForce);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void OnCollisionEnter(Collision collision)
|
void OnCollisionEnter(Collision collision)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user