当前位置:网站首页>[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
2022-07-06 10:18:00 【Two water first wood show】
Plug in links : link :https://pan.baidu.com/s/1ZvOnAvFSowBib3ZJ-ombdw
Extraction code :sen5
After importing the plug-in, go directly to Jelly Sprite Demo Scene scene
Core script description :
Body Configuration Determine the shape of the spring ,Num Colliders Number of springs ,Collider Radius Spring radius ,Collider Scale Spring size , Num Attach Points Number of bundled nodes , Attach Point Bundle nodes Eyes
The shader of the object where the script is located is dynamically generated , Shaders will default to Sprite/Defaults Shaders , Maps use UnityJellySprite Of Sprite Parameters ( The first parameter )
Material compatible processing :UnityJellySprite The main texture setting method of the script may be different from that of the old version, and there are also problems of space determination and error reporting, which are modified as follows .
If you need to use your own shader to render the elastic sphere, modify Shader.Find("Sprite/Default") Content is enough .
BlobBehaviour.cs Script description : It is a random time to add a Force The effect of , Let the sphere bounce .m_JellySprite.AddForce Interface to add force ( Note that it is not a rigid body component yes JellySprite(UnityJellySprite Parent script )
problem : How to know collision detection events ?
After running the game, you will find a pile of such objects
It has scripts to monitor physical collision events , And sent events to our objects
So just add event methods to the object script , When it collides with an object, it will send an event to trigger .
Because there are many spring colliders , And the name is the object name Ref Point n In the form of , So we can split the object name and take the first string To identify which sphere it collided with .
We can use these events to do something interesting , such as : A replica of synthetic watermelon .
边栏推荐
- The 32 year old programmer left and was admitted by pinduoduo and foreign enterprises. After drying out his annual salary, he sighed: it's hard to choose
- Some thoughts on the study of 51 single chip microcomputer
- Constants and pointers
- MySQL实战优化高手11 从数据的增删改开始讲起,回顾一下Buffer Pool在数据库里的地位
- The appearance is popular. Two JSON visualization tools are recommended for use with swagger. It's really fragrant
- MySQL实战优化高手03 用一次数据更新流程,初步了解InnoDB存储引擎的架构设计
- What is the current situation of the game industry in the Internet world?
- Super detailed steps to implement Wechat public number H5 Message push
- The programming ranking list came out in February. Is the result as you expected?
- The governor of New Jersey signed seven bills to improve gun safety
猜你喜欢
Typescript入门教程(B站黑马程序员)
Complete web login process through filter
What should the redis cluster solution do? What are the plans?
MySQL Real Time Optimization Master 04 discute de ce qu'est binlog en mettant à jour le processus d'exécution des déclarations dans le moteur de stockage InnoDB.
Not registered via @enableconfigurationproperties, marked (@configurationproperties use)
Southwest University: Hu hang - Analysis on learning behavior and learning effect
MySQL combat optimization expert 12 what does the memory data structure buffer pool look like?
17 medical registration system_ [wechat Payment]
History of object recognition
Embedded development is much more difficult than MCU? Talk about SCM and embedded development and design experience
随机推荐
Implement context manager through with
Compress decompress
颜值爆表,推荐两款JSON可视化工具,配合Swagger使用真香
13 medical registration system_ [wechat login]
Several errors encountered when installing opencv
NLP routes and resources
Constants and pointers
17 medical registration system_ [wechat Payment]
Random notes
MySQL实战优化高手03 用一次数据更新流程,初步了解InnoDB存储引擎的架构设计
History of object recognition
Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)
14 medical registration system_ [Alibaba cloud OSS, user authentication and patient]
MySQL底层的逻辑架构
MySQL的存储引擎
How to make shell script executable
宝塔的安装和flask项目部署
简单解决phpjm加密问题 免费phpjm解密工具
MySQL实战优化高手04 借着更新语句在InnoDB存储引擎中的执行流程,聊聊binlog是什么?
The replay block of canoe still needs to be combined with CAPL script to make it clear