- Home /
Trying to warp a character correctly
Guys I'm facing this small problem in warping my character in between scenes. The warp seems to be working fine but the object seems to be changing its color. (I'm very new to unity) 

My simple Warp script:
using UnityEngine;
using System.Collections;
public class Warp : MonoBehaviour
{
public Transform warpTarget;
void OnTriggerEnter2D(Collider2D other)
{
other.gameObject.transform.position = warpTarget.position;
Camera.main.transform.position = warpTarget.position;
}
}
Any help would be appreciated. Thank you. ^^
You said "warping character in between scenes", but the code snippet has no scene switching at all. Did you mean, the lighting changes when the character warps (within the scene)?
How is the lighting set up? Is it parented to something? is real-time or baked? The more info you can provide the better. As-is, it's hard to tell what's wrong here.
1.It's warping from one point to another within the scene. 2.For Lighting i setup point sources and added Sprite-Diffuse material to my sprites. 3.The chair after the warp loses its original color. It becomes way dark and the light sources have no effect on it.
Your answer