FIRST PERSON INTERACTION in Unity!
Вставка
- Опубліковано 15 чер 2023
- In this tutorial we'll learn how to make an interaction system for first person games!
LINKS
Starter Project:
github.com/tdawsondev/FirstPe...
Outline asset:
assetstore.unity.com/packages...
Simple Items Pack:
assetstore.unity.com/packages...
Patreon:
www.patreon.com/Kabungus
Thank you very much for this tutorial, it saved me a lot of time on my final project as the previous tutorial made me having a problem with the outline working only after clicking for the first time in an object
Very nice video man! THX
Make more videos like this... I'm gonna support you man....
You best man, thank you very well
Amazing Thanks~
Good content broo awsome ❤
thanks for this but it would really help to explain the lines of code more thoroughly (just like you did for the if statements), more like explaining the logic behind each line in more of a beginner friendly manner. wish you the best
Well all he did was first create a script called Interactable (You will need to add this script to every single thing you wish to interact with in the game.) This script also contains a message which you will see when you go near it and a UnityEvent (Here in the inspector you attach the function which you wish to run when someone actually presses the interact button) basically what happens when someone interacts with your interactable. for a light switch you will attach the function which turns on the light.
Then we create a new script called Player Interaction. This script is responsible for actually interacting with the object. Here we just shoot an imaginary line from the center of our screen (called a ray) and if that line hits the interactable object then we know that this is the object we need to interact with.
Ofcourse there is more to this but this is the basic outline of the video.
Let me know if this helps.
I really liked the Tutorial and therefore I subscribed. Thanks for really great video.
So... let's say nothing works on my end. What's the procedure?...
There is also a problem, if there is no collider, then the outline will be enabled until you collide with another object that has a collider, for that make sure to place a cube in your camera and place it on top of the raycast. that will solve the problem; xD edit: of course a collider which has another tag to make sure your script has "else{ disableOutline }"
can it play a door animation
It doesn't work great for me, might because that I don't know where to put in the components, so, I replaced the raycast with a collider! I even made a object pickup system
i did the exact same script and doesn't let me change anything in unity :')
Where is Outline script from?
I think it’s a component
is it just me or did he just jinx me with only giving me the interact script then telling me to place another script that "we" aprenetly made
hello, may I ask for the project?
What does the error "The type or namespace name 'interactable' could not be found (are you missing a using directive or an assembly reference?)" mean?
You renamed or misspelled the script name or the class name (the thing before : MonoBehaviour). In the video the script name is capitalized so maybe check if your Script/Class is called Interactable and not interactable.