用到这个api函数接口 Mathf.PingPong
![[Pasted image 20230704152538.png]]
在代码里,其中一个是,如果位置不对的时候,move移动,否则就做往返运动
![[Pasted image 20230704152612.png]]
在这里是整了一个定时器,然后,是调用这个api接口,进行往返运动
![[Pasted image 20230704152751.png]]
收集到一个眼泪之后,如果眼泪不是跟随,就可以看到效果了
![[Pasted image 20230704152855.png]]
这个是跟随玩家移动的相关逻辑,有一个targetTrans的
![[Pasted image 20230706150520.png]]
是前面从主角身上子物体获得的
![[Pasted image 20230706150558.png]]
线性插值移动api
![[Pasted image 20230706150655.png]]