The question is answered, right answer was accepted
Same Q as before but it has been a while and nones replyed so im reposting
Heres the latest issue: Im trying to make a cutscene, no errors yet when I use it, it disables movement but dose not switch cameras! Its bugging me :-/ Heres the code!
The reset I made I put in // as It was not working I think my IF is not done right :-/ Anyway please say if you know a reason why the cameras don't switch! Here is a pic of how I configured it to show I configured it right. : https://gyazo.com/813cbf5fb88df7a4bc1287b4adcb034f (I hope)
Answer by 1sd15 · Dec 02, 2017 at 09:01 AM
Hey past me, I got an answer for ya!
So, if you are using Unity 5.0 or higher, to do this you need to use the ".SetActive" to change activity.
Here is a snippet of code that shows it in action:
if (CKeyCounter == 4) { TopDown.SetActive(false); FirstPerson.SetActive(true); }
So, to make an object disabled in the hierarchy, first get the object then set it to either (false) or (true) accordingly.
Hope this helps! Not the best report or answer I've done. Kinda rushing it. :P
So, this will disable the object you set it to in the Hierarchy, meaning it will be uncallable. Make sure you have a VAR or GameObject set to this object before you disable it, or you may have some issues. If you are using the old way of calling an object and not storing it, consider changing that.
Answer by jmonasterio · Jan 03, 2016 at 04:56 PM
Use camera.active instead of camera.enabled.
Wouldn't it just be easier to disabled the object with SetActive()?
Follow this Question
Related Questions
Player jumping issue 2 Answers
why do i keep getting compiler errors even though my script has no errors? 2 Answers
Is it possible to make an Okami Brush mechanic in Unity Engine? 0 Answers
Script + How to setup animator controller 0 Answers
How can resolve URL with caracter like & and other ? 2 Answers