Disable skid marks and braking sound when taking off - #79
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/racing-game/2XeGGsg3kY6eYS7THy9KXxZhqG2o |
|
good idea, we need this! though cannon can tell you if wheels are in the air https://pmndrs.github.io/cannon-es/docs/classes/wheelinfo.html#isincontact it isnt exposed in use-cannon yet but i think that would be more flexible than testing position.y. i'll have a look tomorrow in the evening. |
|
That would be awesome to have in use-cannon! I am not sure if the frictionSlip without the friction cooefficient data is working though properly. I think there is the contact material as well needed to get a nice drift possibility physics. But correct me if I am wrong :) |
| if (!honkAudio.current.isPlaying) honkAudio.current.play() | ||
| } else honkAudio.current.isPlaying && honkAudio.current.stop() | ||
| if (brake && state.speed > 20) { | ||
| if (brake && state.speed > 20 && rightRearWheel.position.y < 0.29 && leftRearWheel.position.y < 0.29) { |
There was a problem hiding this comment.
can the hardcoded values be changed to constants
There was a problem hiding this comment.
I meant the speed.. I don't think we are going to be using the wheel position like that since @drcmda commented about the isInContact prop:
good idea, we need this! though cannon can tell you if wheels are in the air https://pmndrs.github.io/cannon-es/docs/classes/wheelinfo.html#isincontact it isnt exposed in use-cannon yet but i think that would be more flexible than testing position.y. i'll have a look tomorrow in the evening.
There was a problem hiding this comment.
@njm222 ok I understand what you mean, let me change that
There was a problem hiding this comment.
Shweet! Don't forget to bump the version of use-cannon
There was a problem hiding this comment.
i dont think its yet possible, needs a quick fix so that nested props can be observed
No description provided.