- Home /
Question by
rahulpatil9985 · Aug 13, 2020 at 04:54 AM ·
unity 2d
how to apply the scale in and scale out effect on the obstacle
I want to apply the effect on an obstacle like scale in and scaleout
see original effect video
https://www.youtube.com/watch?v=_Tq4t0gx49g&t=569s
public void Start()
{
ScaleINOutAnimation(this.GetComponent<Transform>(), 0.59f, 0.13f, 0f);
}
public void ScaleINOutAnimation(Transform objectTransform, float scaleIn, float scaleOut, float duration)
{
objectTransform.DOScale(scaleIn, duration).OnComplete(() =>
{
Debug.Log("Scale In done.");
objectTransform.DOScale(scaleOut, duration).OnComplete(() =>
{
ScaleINOutAnimation(objectTransform, scaleIn, scaleOut, duration);
});
});
}
I think the main issue is the obstacle size scale in and scaleout
I am using Dotween Plugin for give the effect on dotween plugin
reference:

help
Comment
Your answer
Follow this Question
Related Questions
Check whether any collision has occured to spawned game objects 0 Answers
Image as boundary 1 Answer
Unity 2d navmesh for a tilemap 1 Answer
LineRenderer fade out 0 Answers