I am creating a game where you control a car and deliver/pickup stuff. On my map there are roads and grass and I want to make the car go slower while on the grass as opposed to the roads. I tried making the friction to max but there is barely any noticeable difference and I can’t seem to find any way to do this programmatically.
Here is the project link: https://playcanvas.com/editor/project/411200
Thanks in advance for any help!
Before I comment on your actual question, can I just point on that you have imported a very heavyweight FBX file: Tree1.fbx:
As you can see, it has 1,202,809 vertices and 661,484 triangles! Just this model is adding 19.4MB to your download size for your game:
I would recommend getting rid of it. Also your FadeX-Access-Denied.mp3 is 7.9MB. You could probably resample that to a lower bit rate and reupload.
Do pay attention to asset sizes that can result in long load times.
Oh thank you haha I will definitely clean up the code and assets soon!
How about this?
I already tried setting the friction to 1 but it doesn’t slow it down as much as I would like it to and since the friction is maxed out at 1 I can’t raise it any higher
You have to set friction on both the ground and the vehicle, right? Is the behaviour in my project not what you want?
It is but for some reason the change is not as noticeable in my project for some reason. I did set it on both
Check this out:
Looks like the Editor UI shouldn’t prevent you from setting friction of greater than 1 (cc @max).
If you do want to set a friction higher than one, you can do it in script:
this.entity.rigidbody.friction = 2;
Oh yes that works great! Thanks for your help!