unity concavunity edge colliderr是不是需要pro

Unity 5 workaround for concave colliders - Unity Answers
Navigation
Unity account
You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio.
Unity 5 workaround for concave colliders
As excited as I am to try out Unity 5, I can't.
My game is set in space and I have some detailed meshes as the ships. These meshes cannot practically be split up into convex meshes, the model is just too large with too much detail.
I am thinking about a workaround but I beleive my limited knowledge is getting in the way. Under the assumption this method can be made to work it is a fairly decent and simple solution without any external assets etc.
Can this work?
Firstly, the model meshes need to have a parent which is a child of the Prefab. This is so that I can attatch a script to their rigidbody Object, that is still a child of the ship. This rigidbody in use for the meshes must be set as kinematic due to the Unity 5 update. I have applied a second rigidbody to the Prefab (parent Obj). The Prefabs rigidbody can utilise the physics and the models rigidbody allows concave collisions. I am creating a basic script, which I need help with, that will pass collisions on the model rigidbody to the Prefabs rigidbody, allowing the collisions to effect the ship.
The script is applied to the model kinematic rigidbody, on all objects needing concave colliders.
Heres what I have so far..
using UnityE
using System.C
public class ScriptPassCollision : MonoBehaviour {
void OnCollisionEnter(Collision collision) {
float mass = collision.rigidbody.
transform.parent.GetComponent&Rigidbody&().AddForceAtPosition(Vector3.Scale (collision.relativeVelocity,new Vector3(mass,mass,mass)),collision.rigidbody.position);
This seems to be working to a degree..
The effect seems way too much, is my math wrong? the ship rotates, but stops again soon after? very confused here and may have external influence.. and lastly the ship doesn't move as i would expect add force to do?
Feel free to leave suggestions in rewriting the idea altogether.. I've stayed up too late :)
There are no issues with using concave colliders in Unity 5. Concave triggers are another matter, but you don't seem to be using those.
Hint: You can notify a user about this post by typing @username
Attachments: Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
4 People are following this question.扫一扫,访问微社区
后使用快捷导航没有帐号?
签到成功!您今天第{todayrank}个签到,签到排名竞争激烈,记得每天都来签到哦!已连续签到:{constant}天,累计签到:{days}天
当前位置: & &
230 / 262 页
& && &&&如题,想问下各位大大们都用的什么版本的啊 3个插件可以适配吗?
Virtual Reality Projects. Chapter 4
本节为 Virtual Reality Projects 全书中的一节,更多内容:
返回:Virtual Reality Projects 目录 ...
评估App的时间和空间特性:
极限测试:在各种边界压力情况下,如电池、存储、网速等,验证App是否能正确响应。 --内存满时安装App
unity5.4.0打开源码项目,误商用。

我要回帖

更多关于 unity3d collider 的文章

 

随机推荐