Tag Info

Hot answers tagged

1

How the author specifically got that value was via experimentation. From the comments: Q: Hi James, you set acceleration.y to 460. How did you find this number? Is it static? A: Acceleration was experimentally determined. Its value does not change. And this is often the case when determining values for your game. You pick a value and play-test ...


1

The simplest, modestly realistic, model I can think of would be parameterized by the following: Mz The Turning Moment of the ship about the steering (ie Z or yaw) axis; L/2 The distance of the rudder from the turning axis, approximated as 1/2 the ship's length L; v The current linear velocity of the ship (relative to the water, not the land nearby, ...


1

Let's say I have three circles. (I'm gonna say circles because if I called them balls, that sentence would sound weird.) What this example is doing is looking if two circles are overlapping. If they overlap, it'll calculate the distance between the two circles, and the required distance based on the radiusses (radii? whatever). It then moves the circles ...


1

The answer is to not have a collide-box on the item/coin itself, but it still needs a rigidbody2D to simulate gravity. We start by finding the objects startposition upon construction. We add a force to it, to push it upwards, to simulate that the item/coin is being 'thrown' out of the dead NPC: startPosY = gameObject.rigidbody2D.transform.position.y; ...


1

I found the answer thanks to this essay Daniel posted. It's something like this (from page 10): desired_velocity = normalize (position - target) * max_speed steering = desired_velocity - velocity


1

Do not put input-updating in FixedUpdate. Probably it's not a full answer, but at least partly your incorrect jumping is because of this: Note also that the Input flags are not reset until "Update()", so its suggested you make all the Input Calls in the Update Loop.


1

Generally with jumping I use Rigidbody2D.AddForce() rather than making changes the velocity. You may find this is a far less painful way of doing jumping and it will still use your Rigidbody (it's also more natural, when you jump you apply force upwards, you don't change your velocity directly). Try swapping out the line for: ...



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