lerp to velocity, quack error
I'm generating GO's to the screen and want to bounce them off a plane. They're controlled by changing positions and leap between it (see commented out line below). Now I want to bounce them by using AddForce, but lerp'ed GO's don't have any.. right?
So I wanted to replace it, but I'm getting a quack is not a generic definition error.. I have no clue how to continue or debug this (I read it). Please let me know if my approach makes any sense at all :)
function FixedUpdate() {
arrayThingies = GameObject.FindGameObjectsWithTag("thingyprefab");
var i = 1;
for (var thingy: GameObject in arrayThingies) {
var curPos : Vector3 = thingy.transform.position;
var newPos : Vector3 = curPos + Vector3(
Mathf.PingPong(Time.time, .3) * Mathf.Cos(Mathf.PI * i),
0,
Mathf.PingPong(Time.time, .2)
);
// thingy.transform.position = Vector3.Lerp(curPos, newPos, 5);
thingy.getComponent.<Rigidbody>().AddForce(newPos);
i++;
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612101312im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Car getting Stuck when having 0 velocity,Rigidbody getting Stuck while having 0 velo. 0 Answers
rigid.velocity.x = 0 for unknow reason 0 Answers
ForceMode.VelocityChange not behaving as expected 1 Answer
Speed limit to AddForce (without limiting velocity of rigidbody) 0 Answers
2D Rigidbody Velocity Being Weird 1 Answer