Transform movement going through Objects?(JS)

So I have a space themed seen set up and I have a big long script working really well, but im having troubles with it. Basically the ship just goes right through everything and ignores colliders of any type.
Im using: transform.Translate (Vector3(0,0,1) * Time.deltaTime*speed);
I was wondering if theres a alternative in JavaScript
Any help would be greatly appreciated thanks!

well, you can find it here, here, here, here and here
unfortunately this means that this question is a spam :expressionless:

I have not used Javascript in a little bit. But the reason why your objects are most likely clipping is because using colliders do not mean there will actually be a reaction to the object. Simply translating an object will basically force it to a position, regardless if there is an object already there.

If you add a rigid-body and add a force, velocity, or impulse in a certain direction, instead of doing a translation, it should work better for you. I can’t really say how to do that in javascript, but here is a reference. Unity - Scripting API: Rigidbody.AddForce

Either do that, or you have to do your own computations to check if you are colliding and hence stop your ship from moving in said direction. Like do an on collision check and then restrict your movement along an axis, or some other direction.