Tag Info

Hot answers tagged

3

I found the solution myself. Here's what I've done: I took the default forward rotation of the firingPoint object, and split it into it's parts - x, y, z, w. Then from these floats, I create a new Quaternion using the constructor method: float randomX = Random.Range(-0.1f, 0.1f); float randomY = Random.Range(-0.1f, 0.1f); float randomZ = ...


3

The problem your having is that motion in games, as smooth as it might look, is better seen as a series of short teleportations. So, since distance is an unsigned value (always greater than zero), your car is just teleporting right past the absolute distance of zero. That causes the check to never go off. You have 3 options: You can add a margin of error ...


1

You could re-order your std::vector<Object> by creating a function that sort it by Y position of your objects void SortObjects() { std::sort(Object.begin(), Object.end(), CompareYAxis); } bool CompareYAxis(const Object first, const Object second) { //Do the comparison here } I think this would work.


1

I would forget right away the option to create the sprites in order based on their y coordinate as it will create a hell for you because it's not a flexible design. You look like you need a common way to handle the drawing process. You can achieve this using polymorphism. I would probably create a IDrawable interface, which requires children to have ...



Only top voted, non community-wiki answers of a minimum length are eligible