how to smooth movement in spesific void and how to create spesific scale trigger

private float bombLocXEnd;
public float SetExpMaxTime;
public GameObject expRotOne;
public float maxExp;
public Transform firstHitPoint;
public bool fireOpen;

	void Start () {
		SetExpMaxTime = 3;
		fireOpen = true;


	}

	void Update () {
		SetExpMaxTime -= Time.deltaTime;



		if (SetExpMaxTime < 0 && fireOpen == true) {
			maxExp = (PlayerSetting.playerCurExpDistance);
			renderer.enabled=false;
			Fire();
			fireOpen=false;
		}

	}

	void Fire () {


		RaycastHit hit1;
		if (Physics.Raycast (expRotOne.transform.position, expRotOne.transform.forward, out hit1)) {
			if(hit1.distance < maxExp && hit1.collider.tag == "Unbreakable"){
				expRotOne.transform.position = Vector3.Lerp (expRotOne.transform.position, hit1.point, 2.0f);

how can I do this smooth I think it isnt smooth because it isnt in the update void what am I suppose to do ?

and I need to create box trigger between expRotOne first location and hit1 location

I’m trying to one direction explosion but if explosion hit something it should stop my expRotOne gameobject has tracer component so its looks like one direction flame or red something

but explosion not smooth, its just going hit1.point in 1 frame I need to do this like 1 or 2 seconds

then I need trigger for player health

what am I suppose to do ?

if there is wrong writing sorry I cant really talk english :slight_smile:

Hey

It seems that your last parameter in your call of the Lerp function is wrong.
You have:

expRotOne.transform.position = Vector3.Lerp (expRotOne.transform.position, hit1.point, 2.0f);

but that “2.0f” as the fraction parameter of the Lerp function is what’s causing the problem.
This parameter is clamped between 0 and 1.

If it’s 0.0f,the Lerp function will return your original position

If it’s 1.0f (or 2.0f or anything >1.0 ) Lerp will return the final position, which is what’s happening in your case.

So, set that parameter to something between 0 and 1, say, 0.25f and see what happens,and then play with this value.

So, change that line to:

expRotOne.transform.position = Vector3.Lerp (expRotOne.transform.position, hit1.point, 0.25f);