IK和粒子的Simulation Space导致的位置错误问题
来源:互联网 发布:淘宝网商城裙子 编辑:程序博客网 时间:2024/05/22 09:51
LateUpdate调用的IK和粒子的Simulation Space导致的位置错误问题
游戏开发中遇到玩家的手枪瞄准右上方,开枪后枪口的火焰粒子会出现在正中间,刚好是没开启IK瞄准的位置,将粒子的SimulationSpace改为Local后问题解决,但是某些烟雾是需要World的.
原因是因为枪口的IK骨胳控制在LateUpdate里,所以粒子渲染后,所以用下面的脚本来强行让粒子位移.
using UnityEngine;using System.Collections;public class ParticleLateUpdate : MonoBehaviour { public Transform target; // The Transform parented to one of the character's bones private Vector3 targetPosition; private Quaternion targetRotation; void Start() { LateUpdate(); } // Move this ParticleSystem to the target's last frame position before it emits void Update() { transform.position = targetPosition; //transform.rotation = targetRotation; } // Read the world space position and rotation of the target after procedural effects have been applied // NB! Make sure this script is set to a higher value than FinalIK components in the Script Execution Order! void LateUpdate() { targetPosition = target.position; //targetRotation = target.rotation; }}
粒子不能放在枪口的挂点的相对位置,要挂在不受到IK影响的位置,仍到Root里也是可以的.
0 0
- IK和粒子的Simulation Space导致的位置错误问题
- emulation和simulation的区别
- simulation和emulation的difference
- white-space: nowrap 导致有宽度也不换行的问题
- 硬盘分区表错误导致的问题和解决过程
- Linux和win10双系统导致win10时间错误的问题
- 结构体的定义位置不正确导致的错误
- doom3 步行IK编辑器 和 粒子编辑器
- Android library版本决定它的高度和宽度导致的位图位置出错问题
- VS中DLL的导出宏的定义和头文件的位置导致的两类编译错误总结
- @Controller的一个错误导致的问题
- 由于JDK版本问题导致的错误
- XML编码问题导致的错误
- 异常的错误使用导致性能问题
- QT 线程导致奇怪错误的问题
- 关于项目路径问题导致的错误
- 因编码格式问题导致的错误
- CCClippingNode导致的贴图错误问题
- Android 分享功能之 微信 图片分享
- iterable和for-each循环集合的注意事项
- jQuery事件绑定
- 小马哥杂牌机高仿机刷机教程---史上最简单的卡刷方法。adb推送模式自动卡刷教程
- sun solairs安装11gr2RAC,界面打不开
- IK和粒子的Simulation Space导致的位置错误问题
- Android Studio异常"The plugin org.jetbrains.android failed to save settings and has been disabled"处理总结
- [note] 既然 typedef, 为何还要使用 define?
- Vagrant共享
- XPath学习:基本语法(一)
- 解决数据库性能瓶颈的几种方法 - NoSql视角(草稿)
- 圆形进度条
- android的消息处理机制——Looper,Handler,Message
- JNI官方规范中文版——从一个简单的例子开始