I haven’t really scripted that much, so i don’t know alot about these things.
I just need a simple script that when you press E near a bench (maybe making a collider at each one)
it will sit down on the bench?
please help me, i only have 2 weeks more left of this school project ![]()
thx
So, first make an animation of a player sitting on a bench. Then, yes, use OnCollisionEnter, and have an if statement for if e pressed (you can find it almost anywhere.) Then, trigger the animation when e is pressed.
if (Input.GetKeyDown("space"))
Debug.Log("space key was pressed");
Then use:
animation.Play();
To play your sitting animation
Use an empty collider to find the OnCollisionEnter
Good luck to you! I feel bad for your near deadline