- Home /
How do I make an object appear differently to different players?
I want to implement a form of time travel in my game. There will be select locations that span time, allowing you to converse with players or key npc's in other time periods, but I want these locations to appear appropriate to the players respective time period. So, to simplify, is there a way to make a mug appear as carved out of bone to player 1, but ceramic with glowing symbols to player 2?,My game will have a form of time travel between periods. One location will span all time, allowing someone in the past to meet and talk to someone in the present or future, however I want the location to look apropriate for the respective timezone.
So, to simplify the scenario, how would I make player 1 see a carved bone mug where player 2 might see a ceramic mug with painted symbols, or something similar?
Answer by theunreal · Jun 05 at 12:55 AM
Oops, accidently typed the question twice, please overlook this error.
Answer by maxkcy · Jun 05 at 05:02 AM
I don't have my editor available, as I'm building a game out. So just going to tell you what I think I'm going to do. First I will try putting child objects with sprite renderers that render on different sorting layers, and check if sorting layers for camera can be disabled, or culled.
For each player that is near by, just activate the render object for that game. Suppose 3 players are near, then activate 3 children with the different sprite renders on different sorting layers. Then have the cameras cull out the sorting layers, or disable the sorting layer.
This is all theory. What I'm suggesting might not be possible. I'd like to be updated.
Sorry for the slow update. I am still very new to Unity, so I only had an idea but no clue how to make it work. Thanks to your answer and some google, I now know about layers and the culling dropdown within the camera.
It seems to be working.
I think that works, got my player object and the Parent game object set on a plane (called interactable), both with child objects set to other layers (medieval, modern, and future) for visuals. Then with the player camera (on the interactions layer) I went into the culling mask dropdown to hide layers I don't want that player to seem
I have to add some interactions later to confirm that when the player parent objects interact with the mug's parent object, that the child objects on each layer are moved properly, as it seems that when I move the parent object in the scene view, the child objects also move. If it works the way I think it does, both players would be able to see the other interact with their surroundings, even though one is seeing a medieval version and the other a futuristic version of the same surroundings.
Your answer
Follow this Question
Related Questions
Swaping to a camera attached to another object 2 Answers
How animation tow objects in different time sequential 0 Answers
Find Script from another script 2 Answers
Objects appear randomly in specific length and height 1 Answer
How to call back specific file info for different players using c#? 0 Answers