Hey guys, So here's a interesting question me and my friend are trying to figure out for a quick game were working on to take a break from the bigger project. its a tron like game where you spawn a wall behind your character and if another player hits it they die. Here's the problem online the player prefab is the same so when you run into the other players wall nothing happens because it's tagged as your wall as well. Is there a way i could write a script to say if the wall you hit didn't spawn from local player then die? Thanks in advance.
Answer by Commoble
Mar 20 at 05:53 PM
Instead of using tags, the walls should have data about which player created them.
that's what i was starting to think.
how could i classify what player spawned them in if all the players are from the same prefab?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
4 People are following this question.
how can I change a light with multiple triggers. ?
Why when using get; set; in one script i'm getting null in other script that use it ?
How can i avoid mouse double click on second time to make my player idle ?
Instantiate with .obj
Does anyone know why this simple player camera lock script is not working?