Hot answers tagged

75

Give the ball a height value. Draw a shadow at the ball's actual 2D position; the shadow will help spatially orient the ball for the player. When you draw the ball itself, offset the Y position by the "height" of the ball. If you want to implement more than just an illusion, use this height value in computations as well -- for example, you can implement the ...


74

Shadow and texture. Texturize the ball to show it rotating. This helps give the illusion of rotation of a sphere, which is more than 2 dimensions. A shadow can trick your brain into believing all sorts of things. Making flat things look like they have a third dimension. You don't even have to change the height of the ball, you just need to change ...


3

Your starting velocity is a vector, not a scalar (to be pedantic, V0 is actually the speed, i.e. the magnitude of the velocity). If v0x= v0*cos(a) and v0y= v0*sin(a), then your analytical solution for the positions is correct: sx(t) = v0*cos(a)*t and sy(t) = v0*sin(a)*t - g*t^2/2. Your question is ambiguous, but assuming you want to find the launch speed ...


3

A rational approach might be to simplify your problem. This is a game, so most of the time there is no need for 100% accurate physics. Instead of tracking every single component that makes your ship, you can instead prepare several damaged ship models and swap then on the fly as it gets more and more damage. When you swap the models, you could spawn some ...


2

When you are dealing with AddForce and AddTorque, you are simulating physics. You are utilizing the RigidBody component of your physics engine. Do you require a physics engine for your game? Or do you want to fake the physics yourself? You cannot apply forces to a transform. You also don't need to have a RigidBody component on your gameobject in order ...


1

Adding force means you are simulating some degree of pysical movement. Do not play with vector(force) if you do not need to simulate physical property in your game.


1

This link looks interesting and provides almost that what I need, maybe it can help somebody too http://forum.unity3d.com/threads/animfollow-active-ragdoll-is-now-free-to-download.220812/


1

As you probably already know based on how you formulate your question, the physics engine only registers collisions whn at least one of the colliders have a rigidbody attached. In many cases you can just add a kinematic rigidbody that is not affected by gravity to get a collision detection going. Unfortunately the Collision2D.ContactPoints, which is of type ...


1

Shadow and Ball are key aspects. Shadow size and distence between Ball and shadow should increase when height increase. Also, Ball size should increase when Ball height increase. Shadow position represents position of ball in 2d and when Ball height increase you have to change Ball position (I m assuming that light source is homogen and it is not single ...


1

Set the new Physics Material on the object you are colliding with. Make sure you set the friction to 0. http://docs.unity3d.com/Manual/class-PhysicMaterial.html


1

Create four GameObjects. Add a Collider to each GameObject. Set the physics material of each Collider. http://docs.unity3d.com/Manual/class-PhysicsMaterial2D.html Set the bounciness to the value you want in the Physics Material. Each GameObject would have it's own physics material with specific bounciness.


1

In Alto's Adventure, the terrain is dynamically generated over time, by concatenating prefabricated patterns (for example the super steep slope where you can perform a triple backflip, or any other soft slopes) in a randomic way to keep the game various from play to play. A possible implementation can be treating these "pieces" of terrain as vertices, from ...


1

When in doubt: Fake it. Instead of calculating the wheels from where the cart is, calculate the wheel direction from where the wheel was. Something like this: //Constants, per wheel. I'm assuming Y is up/down var wheelOffset = Vector3( -40, 0, -10 ); //Variables kept over multiple frames, per wheel var wheelAngle = 0; var lastWheelPosition = 0; //Per ...



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