Hey, my bad I forgot to correct the title. There will be more related stuff , like picking up items and such. But for that we'll need an inventory system, that's why the next video is about inventory
I didn't setup any animation in the video but you have the method where you do the interact logic. From there call your animator and play your desired animation.
@@Antarsoft Forgive me for my impudence, but for a month I have tried in every possible way to add interaction with the animator, but nothing works (the animator itself works if you manually check the "Interact --> true" checkbox in the Animator). Can you tell me what is wrong please? public class InteractableObject : CollidableObject { private bool z_Interacted = false; public Animator objectanimator; protected override void OnCollided(GameObject collidedObject) { if (Input.GetKey(KeyCode.E)) { OnInteract(); } } protected virtual void OnInteract() { if (!z_Interacted) { z_Interacted = true; objectanimator.SetBool("Interact", true); Debug.Log("Interact with " + name); StartCoroutine(DoInteraction()); objectanimator.SetBool("Interact", false); }
Great Tutorial it really helped my Game
Glad it helped
These videos are great, I wish they got more recognition! What unity extension are you using for VS?
Thanks, you really made my job eaiser!
Glad it helped
Great video!
Thanks
This video is amazing!!
Thank you ❤️❤️
Would love to have you as a subscriber 😇
Great tutorial
Thanks
Perfect ! Thank you ! I can‘t find the 2nd part. Is there already the 2nd part ?
Hey, my bad I forgot to correct the title.
There will be more related stuff , like picking up items and such.
But for that we'll need an inventory system, that's why the next video is about inventory
@@Antarsoft okay i see, this is great, i‘m really excited 🤩
Same here 😎😎 please do subscribe, would love to have you as a sub 😇
nice video
Thank you
I cant change modifiers when overriding a protected void...
How can I change the opening and closing animations?
I didn't setup any animation in the video but you have the method where you do the interact logic.
From there call your animator and play your desired animation.
@@Antarsoft Forgive me for my impudence, but for a month I have tried in every possible way to add interaction with the animator, but nothing works (the animator itself works if you manually check the "Interact --> true" checkbox in the Animator).
Can you tell me what is wrong please?
public class InteractableObject : CollidableObject
{
private bool z_Interacted = false;
public Animator objectanimator;
protected override void OnCollided(GameObject collidedObject)
{
if (Input.GetKey(KeyCode.E))
{
OnInteract();
}
}
protected virtual void OnInteract()
{
if (!z_Interacted)
{
z_Interacted = true;
objectanimator.SetBool("Interact", true);
Debug.Log("Interact with " + name);
StartCoroutine(DoInteraction());
objectanimator.SetBool("Interact", false);
}
}
IEnumerator DoInteraction()
{
yield return new WaitForSeconds(.1f);
z_Interacted = false;
}
}