Beispiel #1
0
        private void AttachToObject(GameObject hitObject, Vector3 hitNormal)
        {
            hookBody.transform.parent = hitObject.transform;

            hookBody.MakeKinematic();

            HookManager.Debugger.SendLog($"Tamanho do objeto (localmente) :{hitObject.transform.localScale}");
            transform.localScale = CorrectScale(hitObject.transform.localScale, hookScale);

            foreach (Collider collider in hookBody.GetComponentsInChildren <Collider>())
            {
                collider.isTrigger = true;
            }

            hookBody.transform.rotation = Quaternion.FromToRotation(hookBody.transform.forward, -hitNormal) * hookBody.transform.rotation;

            HookManager.IsGrappling = true;
        }