GTkoi Posted October 9, 2019 Share Posted October 9, 2019 hello, it is possible, to place coins in my games and when you pass them, it picks them up and increases a coin counter at the top of the screen, do you know how to do that ? (code) For exemple : Mario Quote Link to comment Share on other sites More sharing options...
Abstergo Posted October 9, 2019 Share Posted October 9, 2019 In the UpdatePhysics method for coin, I'd test for the distance between the player's vector and your coin's, then call the function for the pickup when it's in range. I don't know the Lua equivalent but in C++ you'd need to call this: virtual float DistanceToPoint(const Vec3& p); For example: Vec3 v3_first = Vec3(0.0); Vec3 v3_second = Vec3(1.0); v3_first.DistanceToPoint(v3_second); // Will return distance between Vec3(0.0,0.0,0.0) and Vec3(1.0,1.0,1.0) 1 Quote Link to comment Share on other sites More sharing options...
GTkoi Posted October 10, 2019 Author Share Posted October 10, 2019 ha it's good, I found, thank you 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.