I am a beginner in Unity 5.0.
It is hard to describe my problem, so I included 3 images. please see following:
http://frankiegamescom.ipage.com/question.html
please help. Thanks.
I am a beginner in Unity 5.0.
It is hard to describe my problem, so I included 3 images. please see following:
http://frankiegamescom.ipage.com/question.html
please help. Thanks.
I don't think you should be changing the isTrigger property of your car_player in your code. It looks like this would be a better solution:
Leave the box colliders on your car and road blocks to not be triggers. Let the grass's box collider be a trigger. 2D Rigidbodies would only need to be on the the road blocks and the car. Then the car should stop when hitting the road block if you're moving it correctly; that is by Rigidbody2D.AddForce or velocity.
If you are using Transform.Translate then then I think you would need to add a Rect.Overlaps infront of your car and check for collisions manually.
Edit: Looking at your screenshots again, it looks like just leaving your cars isTrigger to false and leaving the grass colliders isTrigger to true might solve your problem. And maybe use OnTriggerStay2D to to pass a multiplier for your drag.