gravity and collision + beginner questions

Hey

I’m quite new to C# and javascript
I’m trying to make the object not fall through the floor, but it shouldn’t be colliding with other objects then object “floor”.

Feel free to suggest guides (beginner) - Should I focus on C#, java or both?
Do it matter if I use some C# and some Javascript in my games or doesn’t it matter?

This code is just something I tried… I didn’t know it would be this hard moving from Game Maker to Unity.

using System.Collections;

public class gravity : MonoBehaviour {

void Start ()
{
}

void Update ()
{
}

void OnTriggerEnter(Collider other)
{
	if(other.gameObject.tag=="Floor")
			rigidbody.useGravity = false;
}

}

Utilize this website often: https://docs.unity3d.com/Documentation/ScriptReference/

It is basically the manual for scripting.

Using the search bar on the left you can search through the document for specific references like (OnCollision, OnTrigger, Transform, etc).

It is recommended that if you’re developing a game to only utilize one scripting language. Mixing isn’t the greatest idea.

I just posted this in reference to materials for scripting resources (For Learning) : http://forum.unity3d.com/threads/219685-Are-there-lessons-to-learn-UnityScript-(Javascript-in-Unity)?p=1465884&viewfull=1#post1465884

Check it out. Good luck.

I suggest learning C#. It’s my favorite language. I like it better than UnityScript. Either way, I’d pick one language and stick with it.

I wouldn’t turn gravity off. The collider itself should be enough to stop the object from falling through the floor. If your object needs to collide with the floor but not other things, Unity has “Layer-Based Collision Detection” so you can control what collides with what.