Quantcast
Channel: Questions in topic: "contact"
Browsing all 75 articles
Browse latest View live

OnCollisionEnter not working

Hey I am trying to make a simple collision detection scprit. I have tried it several times in different projects, and it seems to not work. It is written in C#, i have tried using this in various...

View Article



Skateboarding Game

So I have an idea for a potential skateboarding game, but I honestly have no idea where to begin when it comes to the board staying in contact with the ground like a car would up and down hills, as...

View Article

Collision with terrain

I have a script where it detects collision and then causes an explosion. For some reason the collision isnt detected until the object is in the center of the collider(terrain). The explosion doesnt...

View Article

Bullet Marks on surfaces with bump mapping?

else { //bullet must have hit a wall/floor/object in level Debug.Log("AK47 shot hit:" + myCollision.gameObject.name); var contact : ContactPoint = myCollision.contacts[0]; Debug.Log("contNormal:" +...

View Article

how would i make a kill on contact script ?

Idont know how to do it or where to start I want it so when my car hits an enemy the enemy dies

View Article


Why is collision.contacts causing a compiler error

I am new to Unity Programming so the compiler error has me stumped. Any help is appreciated. My Code is meant to make a ball reflect, but it is giving me a compiler error on line 11 at...

View Article

Obtaining Collision Information (contact points, etc.) WITHOUT affecting physics

Hi all - I would like to obtain collision information (i.e. contact points, normals) for a collision between two colliders. I was happy to see that this info is already present in the Collision class,...

View Article

Obtaining contact point and normal of first object in collision

Hey guys, I am simply trying to obtain the hit point and normal on my player character mesh after a collision, not the object it collides with, in this case a simple cube. My character has a rigid body...

View Article


OnParticleCollision normal?

I am using legacy particles for blood effects and so far I have splatters appear wherever the particles hit. In the OnCollisionEnter function there's ContactPoint types where you can check the...

View Article


Using contact point

I looked through the script reference page for contact points but I am still unsure on how to use it in my position. I have a for loop that applies to every object within the array setup with on...

View Article

Getting surface normal from collision

When a collision event is triggered, you are returned a list of contact points, from which you can get normals. Unity's manual describes this as the "Normal of the contact point." Not very descriptive....

View Article

Drawing a line along all Contact Points?

Just a quickie. How does one edit a LineRenderer so that it touches all the points in an array produced by a finding all Contact Points of an object. For example, this should effectively create a ring...

View Article

How to use Contact Points to change direction of Ball

Hello, I'm trying to build a simple Breakout game and I'm trying to get the ball to change direction depending on where it hit the paddle. Here is the code I have at the moment. Sorry if it seems...

View Article


How to control OnTriggerEnter() and Reflect() depending on the direction of...

Hey, so I have a scene where a ball will bounce off of a line drawn by a user. As it is, when the ball hits the line, I just call the reflect function in unity. What I've noticed, is that occasionally...

View Article

Problem with contact point

Hi, I tried this script just to get an idea of how contact point works: using UnityEngine; using System.Collections; public class CraneCollisions : MonoBehaviour { void OnCollisionEnter(Collision...

View Article


How can I tell if my character controller is in contact with a wall?

View Article

contacts.normal question

Hi there, I'm trying to check contact point normals when a collisions occur. I basically have an if statement that checks if the contacts.normal.y is not equal to zero. The problem is whether the...

View Article


OnTrigger AI projectile detection and turn.

Ok I need to get my AI to notice bullets being shot into his line of sight and him. He has 2 colliders, one is a trigger which is the vision collider and the other is the capsule collider on the AI...

View Article

Make something happen when touch cube C#

I am very new to C# and scripting in general. How would I make something happen when one object touches another object instead of just instantly?

View Article

Read / Write to phone's contact list.

Hi there I've been asked to firstly: 1. Read the list of contacts on a device. 2. Add contacts to the device's list. Does anyone have any idea on how this may be achieved with Unity?

View Article
Browsing all 75 articles
Browse latest View live




Latest Images