Hello Unity3D.I have a problem with Camera collision.My problem is that i want to make the camera move and rotate to specific positions and the code that i wrote only changes the position of the camera.But i want the position AND the rotate so that the camera rotates on the y-axis something like a 45-90 degrees.If anyone knows how i can do this.Can you please tell me how?Because i can’t find it anywhere for some reason.
Here’s the Script
#pragma strict
var setOnFire : ParticleSystem;
var player :Transform;
var speed = 30;
var pushPower = 2.0;
var sceneCam : GameObject;
sceneCam = GameObject.Find("MainCam");
function Start ()
{
setOnFire.Stop();
}
function OnTriggerEnter (Col : Collider)
{
if(Col.tag == "Player")
if(!animation.IsPlaying("Reverse_Crescent"))
if(!animation.IsPlaying("Wing_Chun_Punch"))
if(!animation.IsPlaying("Wing_Chun_Punch_2"))
if(!animation.IsPlaying("Wing_Chun_Punch_3"))
if(!animation.IsPlaying("Wing_Chun_Punch_4"))
if(!animation.IsPlaying("Wing_Chun_Punch_5"))
if(!animation.IsPlaying("Flurries"))
if(!animation.IsPlaying("Spinning_back_kick"))
if(!animation.IsPlaying("Spinning_back_kick2"))
if(!animation.IsPlaying("Jump_Spinning_Back_Kick"))
if(!animation.IsPlaying("Astral_Ball"))
if(!animation.IsPlaying("Kick_Combo"))
if(!animation.IsPlaying("Kick"))
if(!animation.IsPlaying("Kick2"))
if(!animation.IsPlaying("Chain_Punches"))
if(!animation.IsPlaying("punch1"))
if(!animation.IsPlaying("punch2"))
if(!animation.IsPlaying("punch3"))
if(!animation.IsPlaying("punch4"))
if(!animation.IsPlaying("punch5"))
if(!animation.IsPlaying("Sidekick"))
animation.Play("Hit1");
sceneCam.transform.position = Vector3(2.456752, 1.770302,-1.047782);
sceneCam.transform.localPosition = Vector3(0.09087142, -0.4796396, 0.0500228);
animation["Hit1"].speed=1;
{
setOnFire.Play();
}
}