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++;
}
}