Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
at now car can smooth "rotate" on any ground mesh |
||||
|
sorry, use wrong image link |
||||
|
Looks good.. very useful for tank battle games. |
||||
|
Are you using mesh normals? Or multiple raycast with offset on x and z?:) |
||||
|
i use 4 "ray" (you can see 4 plane) and check height difference for rotate node by x and z |
||||
|
Very intersting! How you made this? Did you sed variables? Did you used javascript? Great job! |
||||
|
andgameplay all made with js |
||||
|
"How you made this?" i've use 4 plane on sides and they work like point for ray down with ccbGetCollisionPointOfWorldWithLine and when get collision in this point i use difference between them as rotation |
||||
|
andgameplay this 4 planes can be introduced as wheel, like front-left (fl), front-right(fr) and back-left(bl), back-right(br). Then we can define rotation by x axis (incline to front and back) is difference between front and back height " (bl.y + br.y) - (fl.y + fr.y) = xAxis " and rotation by z axis (incline to left and right) is difference between left and right " (fr.y + br.y) - (fl.y + bl.y) = zAxis ", if you need it as code i can post it later |
||||
|
Great! It's very good, because simulate much better the irregularity of the ground! I like to developer car racing games, but they always have simple physics controls. I'm very thankful if you could share this code, really thanks :) |
||||
|
@andgameplay sven just posted a similar free behavior script at https://www.ambiera.com/forum.php?t=11543 cheers! |
||||
|
looks nice this kind of programing is hard in my opinion |
||||
|
andgameplay sven made almost same code so you can use it))) https://5v3n.itch.io/coppercube-... |
||||
|
eoh sorry didn't see your wrote so yes you right |
||||
|
Yes, I'm using the Sven code, the both is great! Thanks! |
|