Hi,
I can drag GO (window) and I have texture(outside of window) on this.
How can I stop texture transform under dragging GO?
Any help will be helpful.
Thanks.
Hi,
I can drag GO (window) and I have texture(outside of window) on this.
How can I stop texture transform under dragging GO?
Any help will be helpful.
Thanks.
do you mean the texture is changing when you drag the gameobject?
I have 3D windows and door on the wall.
In the window is showing only a part of the panorama image.
If I drag the window then I’d like to see only the part of the image.
I have soled:)
using UnityEngine;
using System.Collections;
public class TextureOffset : MonoBehaviour {
float scrollSpeed = 0.05f;
Renderer rend;
// Use this for initialization
void Start () {
rend = GetComponent<Renderer> ();
}
// Update is called once per frame
void Update () {
GameObject ajtoX = GameObject.Find("Ablak_ONE");
float offset = ajtoX.transform.position.x*scrollSpeed;
rend.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
}
}