- Home /
Make part of terrain transparent.
So here's a view of my camera (some kind of ortographic perspective).
And if i move character , the mountain hovers it and it can't be seen. Here's example and part i want to make transparent.
My questions are :
Whenever my character becomes invisible due to terrain blocking it vision , how do i catch the part of terrain that has something(plain terrain) after it (so when i make it transparent i won't see skybox)?
Once i have this part of terrain in list/array how do i make transparent ?
Same effect but when in builiding , easier to do ?
If it's impossible to do that due to my beginner skills , are there any other way to make player visible and part of plain terrain so he will know where he can walk(without rotating camera)?
I am wanting to do something similar at the moment and would like to know how to do the same thing if possible.
Answer by NickP_2 · Feb 05, 2014 at 06:39 PM
Too bad there isn't a response yet.
But I did some thinking, and have you heard about the near- and farclipping settings of a camera?
for example:
and now a bigger value for the near clipping will cut off any object in that distance:
And if that doesn't do what you wanted, you can tweak it with a script:
perhaps cast a raycast to your character, and if it doesn't hit the character, add more near clipping, untill it does... Just an idea :)
Aaaaand if that didn't helped, you could try a custom shader to always show the player (maybe with a slight transparant tint) trough walls:
cast a raycast to player, if it didn't hit him, change material to the always on top - transparant - ish shader...
Hope this helps
Your answer
Follow this Question
Related Questions
Terrain not solid 0 Answers
Make a simple tree 1 Answer
Multiplayer game, terrain edit control for 2 characters 0 Answers
Instantiated Objects not Following Perlin Noise 0 Answers
Procedural terrain generation - What exactly does Terrain.Flush() do? 0 Answers