unity3d

How to import an fbx in Unity correctly?

人盡茶涼 提交于 2021-01-06 07:23:08
问题 I've modelled an object and exported as fbx. After I import the asset in Unity, some artefacts show up. The artefacts seem to be related to Unity import and not do the fbx file as the model viewed in Windo3d 3d viever seem to have no issues. Thank you a lot! Object in Blender Edit mode Object in Blender Object mode Object in Windows 3d Object in Unity 回答1: It looks like a triangle winding problem. The order of the vertices in a triangle, when combined with their visual orientation, can be

How to import an fbx in Unity correctly?

落爺英雄遲暮 提交于 2021-01-06 07:23:02
问题 I've modelled an object and exported as fbx. After I import the asset in Unity, some artefacts show up. The artefacts seem to be related to Unity import and not do the fbx file as the model viewed in Windo3d 3d viever seem to have no issues. Thank you a lot! Object in Blender Edit mode Object in Blender Object mode Object in Windows 3d Object in Unity 回答1: It looks like a triangle winding problem. The order of the vertices in a triangle, when combined with their visual orientation, can be

Newtonsoft.Json works in Unity Editor but not on mobile devices

怎甘沉沦 提交于 2021-01-05 14:47:15
问题 I am programming a game of questions and answers by categories in Unity. The categories are obtained through a PHP script that returns a JSON text, * when I use this solution in the UnityEditor it works correctly, but when I install the .apk on my mobile device, deserialization does not work* . The connection to the mysql database and the PHP scripts work correctly because before I log in and it works fine string json = [ { "id_cat":"1", "nombre_cat":"DAM", "id_cat_padre":"0" }, { "id_cat":"4

Newtonsoft.Json works in Unity Editor but not on mobile devices

人盡茶涼 提交于 2021-01-05 14:46:09
问题 I am programming a game of questions and answers by categories in Unity. The categories are obtained through a PHP script that returns a JSON text, * when I use this solution in the UnityEditor it works correctly, but when I install the .apk on my mobile device, deserialization does not work* . The connection to the mysql database and the PHP scripts work correctly because before I log in and it works fine string json = [ { "id_cat":"1", "nombre_cat":"DAM", "id_cat_padre":"0" }, { "id_cat":"4

Newtonsoft.Json works in Unity Editor but not on mobile devices

醉酒当歌 提交于 2021-01-05 14:45:00
问题 I am programming a game of questions and answers by categories in Unity. The categories are obtained through a PHP script that returns a JSON text, * when I use this solution in the UnityEditor it works correctly, but when I install the .apk on my mobile device, deserialization does not work* . The connection to the mysql database and the PHP scripts work correctly because before I log in and it works fine string json = [ { "id_cat":"1", "nombre_cat":"DAM", "id_cat_padre":"0" }, { "id_cat":"4

Unity - raycast is clearly colliding but does not work?

血红的双手。 提交于 2021-01-05 11:06:23
问题 Ok I have 2 objects on the Default layer that I need to trigger a jump with when raycast collides. I can see that the raycast is intersecting the platform: And here is my collider on the platform: And yet nothing is printed with: Vector3 rotation = transform.forward; RaycastHit hit; Debug.DrawRay(new Vector3(transform.position.x, transform.position.y + 0.4f, transform.position.z), rotation, Color.green); if (Physics.Raycast(new Vector3(transform.position.x, transform.position.y + 0.4f,

Unity - raycast is clearly colliding but does not work?

微笑、不失礼 提交于 2021-01-05 11:03:24
问题 Ok I have 2 objects on the Default layer that I need to trigger a jump with when raycast collides. I can see that the raycast is intersecting the platform: And here is my collider on the platform: And yet nothing is printed with: Vector3 rotation = transform.forward; RaycastHit hit; Debug.DrawRay(new Vector3(transform.position.x, transform.position.y + 0.4f, transform.position.z), rotation, Color.green); if (Physics.Raycast(new Vector3(transform.position.x, transform.position.y + 0.4f,

Unity - raycast is clearly colliding but does not work?

十年热恋 提交于 2021-01-05 10:59:18
问题 Ok I have 2 objects on the Default layer that I need to trigger a jump with when raycast collides. I can see that the raycast is intersecting the platform: And here is my collider on the platform: And yet nothing is printed with: Vector3 rotation = transform.forward; RaycastHit hit; Debug.DrawRay(new Vector3(transform.position.x, transform.position.y + 0.4f, transform.position.z), rotation, Color.green); if (Physics.Raycast(new Vector3(transform.position.x, transform.position.y + 0.4f,

初识Unity Mesh

☆樱花仙子☆ 提交于 2021-01-04 12:01:16
Mesh概念: Mesh是Unity中的一个组件,称为网格组件。通俗的讲,Mesh是指模型的网格,3D模型是由多边形拼接而成,而多边形实际上是由多个三角形拼接而成的。所以一个3D模型的表面其实是由多个彼此相连的三角面构成。三维空间中,构成这些三角形的点和边的集合就是Mesh。 Mesh组成 : 1、顶点坐标数组vertexes 2、顶点在uv坐标系中的位置信息数组uvs 3、三角形顶点顺时针或者逆时针索引数组triangles 4、MeshFiler组件,用于增加mesh属性 5、 MeshRender组件,增加材质并渲染出来。 6、可能还需要每个顶点的法线的数组normals using UnityEngine; using UnityEditor; using System.Collections; public class GenMesh { [MenuItem( " GameEditor/scene/Weather/GenMesh " )] static public void GenMeshM() { Mesh m1 = CreateRect(); AssetDatabase.CreateAsset(m1, " Assets/_Resource/model/prefab/weather/m1.asset " ); } public static Mesh

Unity导入3D模型的过程与方法

十年热恋 提交于 2021-01-04 11:57:21
一、介绍 资源是游戏开发中的原材料,也就是组成游戏的模块。 Unity只是一个游戏开发引擎,而并不是一个资源开发软件。这就意味着在游戏中需要的资源通常是由一些设计者使用其他软件开发出来的,然后设计者会将这些制作好的资源导出,并传递给Unity,而Unity负责将这些资源有机地组合到一个游戏系统中。 本文介绍的是如何将3ds Max文件导入进Unity的方法,其他3D模型或文件的导入与此类似。 软件环境:3ds Max2015,Unity 2017.3.0f3 (64-bit) 二、导入步骤 1,在3ds Max软件里设置单位 2,将显示单位和系统单位中的比例设为厘米 3,设置完后创建一个三维立体模型 4,模型导出 导出成max格式,并存放在你所创建的Unity项目里的Assets文件夹下 5,启动Unity 在项目视图中会看到前面已经创建好的三维茶壶模型,将其拖拽到游戏视图中 这样就完成了3d模型的导入,顺便一说,我没加材质和贴图,所以茶壶看起来有些丑,诸位可以根据自己喜好进行三维模型的设计。 三、总结 此次学习了Unity中资源导入的方法,对于以后进行游戏开发的模型导入将会非常有帮助。在此分享一张Unity模型导入的参照表(表来自网上), 来源: oschina 链接: https://my.oschina.net/u/4356045/blog/4057563