An alternative way of using Colliders is to mark them as a Trigger, just check the IsTrigger property checkbox in the Inspector. Triggers are effectively ignored by the physics engine, and have a unique set of three trigger messages that are sent out when a collision with a Trigger occurs. Triggers are useful for triggering other events in your game, like cutscenes, automatic door opening, displaying tutorial messages, etc. Use your imagination!
Be aware that in order for two Triggers to send out trigger events when they collide, one of them must include a Rigidbody as well. For a Trigger to collide with a normal Collider, one of them must have a Rigidbody attached. For a detailed chart of different types of collisions, see the collision action matrix in the Advanced section below. "
I’ve read all that but I’m still really confused. I have an on trigger even that kills the player they collide with a platform. I took that exact script and just replaced the death part with this:
Physics.gravity = Vector3(0, -30, 0);
But it doesn’t work. When I just apply the above script to something on the seen without the trigger the gravity changes. But when I put it with the platform that is a trigger, you just fall through and the gravity never changes
I am by no means smart or good at coding, but it seems if you wanted gravity to change and the character to go up, then the Y should go positive not negative. so maybe it should say. Physics.gravity = Vector3(0, 30, 0); just an idea. hope that helps.
Are you using the standard FPS controller prefab or your own script? If it is the former, that has gravity coded into it as of the last time I saw it; if it is the latter, please post your code using the code tags.