Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Collisions = Get colliding vertices

$
0
0
JS is required but C# will do too I need help to Get the vertices (or nearest vertices) of the collision and some explanation or some links to how to do it Basically I use this script but I found out Contacts aren't in the form of vertices(Local Vector3) and I get an error I need to get vertices and fix the error please I promise to upvote :p //Javascript #pragma strict //Variables to show in inspecor public var ObjectToDeform : Transform; //this gameObject public var DeformMesh : MeshFilter; public var OriginalVerts : Vector3[ ]; public var ModifiedVerts : Vector3[ ]; public var DamageDivider : float; public var HP : float; //Variables to hide in inspector private var OTD: Transform; private var DM = DeformMesh.mesh; private var OV:Vector3[ ]; private var MV:Vector3[ ]; private var DD : float; function Start () { //Initialize all the variables //The Object To Deform OTD = ObjectToDeform; //Original Verts OriginalVerts = DM.vertices; OV = OriginalVerts; //Modified Verts ModifiedVerts = OV; MV = ModifiedVerts; //Damage Divider DD = DamageDivider; } function OnCollisionEnter(collision:Collision){ var CP = OV; Deform(CP,collision.relativeVelocity.Magnitude); } function Deform(CV:Vector3[ ], CM:Vector3):void { } ![Error Log : Error the best overload not valid][1]***The error*** @Osmious [1]: /storage/temp/76577-error-log.png

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>