shield spell, ice bolt adjustments, training dummys

This commit is contained in:
joonasp
2022-04-18 11:29:26 +03:00
parent 5bf99356ff
commit ad1a931c41
12 changed files with 1060 additions and 765 deletions

View File

@@ -43,17 +43,21 @@ public class ActionGestureInteraction : MonoBehaviour
{
Debug.LogWarning("WOODCUTTING ACTION");
}
return;
break;
case "VerticalLine":
if (holdingWand)
{
Debug.LogWarning("WAND VERTICAL");
Vector3 spawnPoint = transform.position + playerCamera.transform.forward;
spawnPoint = new Vector3(spawnPoint.x, spawnPoint.y + 1, spawnPoint.z);
Instantiate(objects[1], spawnPoint, Quaternion.Euler(-90,playerCamera.transform.eulerAngles.y-180,180));
}
else
{
Debug.LogWarning("VERTICAL");
}
return;
break;
case "Circle":
if (holdingWand)
{
@@ -64,7 +68,7 @@ public class ActionGestureInteraction : MonoBehaviour
{
Debug.LogWarning("CIRCLE");
}
return;
break;
case "Triangle":
if (holdingWand)
{
@@ -74,7 +78,7 @@ public class ActionGestureInteraction : MonoBehaviour
{
Debug.LogWarning("WOODCUTTING ACTION");
}
return;
break;
}
/*if (action == "Portal")
@@ -163,6 +167,6 @@ public class ActionGestureInteraction : MonoBehaviour
{
Debug.LogWarning("INSTANTIATE BOLT");
var projectileObj = Instantiate(item, rightHandTransform.position, playerCamera.transform.rotation) as GameObject;
projectileObj.GetComponent<Rigidbody>().velocity = (destination - rightHandTransform.position).normalized * projectileSpeed;
projectileObj.GetComponent<Rigidbody>().velocity = (playerCamera.transform.forward).normalized * projectileSpeed;
}
}

View File

@@ -12,29 +12,39 @@ public class Projectile : MonoBehaviour
// Will always be destroyed after 10 seconds.
Destroy(gameObject, 10);
oldEulerAngles = transform.rotation.eulerAngles;
//oldEulerAngles = transform.rotation.eulerAngles;
}
private void Update()
{
if (oldEulerAngles != transform.rotation.eulerAngles)
/*if (oldEulerAngles != transform.rotation.eulerAngles)
{
Destroy(gameObject);
}
*/
}
private void onCollisionEnter(Collider other)
private void OnCollisionEnter(Collision collision)
{
Debug.LogWarning(collision.gameObject.name);
if (collision.gameObject.tag != "IceBolt" && collision.gameObject.tag != "Player" && !collided)
{
collided = true;
if (collision.gameObject.name == "Dummy") Destroy(collision.gameObject); //REPLACE WITH ENEMY TAG CHECK
Destroy(gameObject);
}
}
private void OnTriggerEnter(Collider other)
{
Debug.LogWarning(other.gameObject.name);
if (other.gameObject.tag != "IceBolt" && other.gameObject.tag != "Player" && !collided)
{
collided = true;
Destroy(gameObject);
}
}
private void onTriggerEnter(Collider other)
{
if (other.gameObject.tag != "IceBolt" && other.gameObject.tag != "Player" && !collided)
else if (other.gameObject.name == "Dummy")
{
collided = true;
Destroy(other.gameObject);
Destroy(gameObject);
}
}