제가 유니티에서 잔상효과는 구현을 해놨는데 그 좌우반전이 안되네요 ㅠㅠ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ghost : MonoBehaviour
{
public float ghostDelay;
private float ghostDelaySecond;
public GameObject ghost;
public bool makeGhost = false;
public SpriteRenderer ghostsprite;
// Start is called before the first frame update
void Start()
{
ghostDelaySecond = ghostDelay;
}
// Update is called once per frame
void Update()
{
if (makeGhost)
{
if (ghostDelaySecond > 0)
{
ghostDelaySecond -= Time.deltaTime;
}
else
{
GameObject currnetGhost = Instantiate(ghost, transform.position, transform.rotation);
Sprite currentSprite = GetComponent().sprite;
currnetGhost.transform.localScale = this.transform.localScale;
currnetGhost.GetComponent().sprite = currentSprite;
ghostDelaySecond = ghostDelay;
Destroy(currnetGhost, 1f);
}
}
}
}
localscale이 아니라 lossyScale로 해보렴 - dc App
lossyScale은 크기조정아닌가요?? 저렇게 좌우반전의 경우에도 효과가 있나요?
뒤집을때 스케일로 뒤집었을수도있자너 - dc App