Help ASAP how to Swap skybox after collision

Is there a way to trigger the skybox to change when the PC collides with an object (or, more specifically, when the PC collides with an object while possessing another object). I just want to add the skybox change to the changes I have already when the FPC collides with this object.

Thanks for any and all suggestions!

2 Answers

2

Hey jonnyfire,

I won’t write your code, but you will need to use Skybox.material… It should be pretty strait forward after that!

-Good Luck ∆ Gibson

Are you getting an error? If your not, I'd say it looks fine... But, its a little hard to read...

–

I have been looking for an answer also and this is what worked for me, very simple.

var mat:Material;

function OnTriggerEnter(trigger: Collider){
	RenderSettings.skybox=mat;
}

You add the script to an object and when the player collides with the object it changes the skybox material to what ever you set it to in the inspector panel.

Matt