Hi guys!
It’s my first time developing a game, and my game is about managing stores… (Place items on shelves, interact with boxes, doors, products…)
I have a question about line trace. Currently I have a line trace in my FirstPerson who makes me able to identify basically all the items that I can interact in my game. I have a lot of validations to know what object the player is looking at, in order to allow different ways to interact.
I do these validations using interfaces or tags for example. But, this is the best way to do something like that?
In my screenshot you can see that I have a lot of if-else to validate what is the object that the player is trying to interact… I know, it’s a mess, but I’m trying to organize my code. It’s working by the way, but I don’t know if it’s the correct way and I would like to have the best approach in my context.
I’d appreciate it if you could leave your opinion…
Thank you for your help!