- Home /
This question was
closed May 17, 2016 at 08:38 AM by
salrad for the following reason:
The question is answered, right answer was accepted
Question by
salrad · May 16, 2016 at 09:23 PM ·
unity 5unity 2drigidbody2dvelocitymovement script
Player is not moving
I have this code in the update function
if(Input.GetKey(KeyCode.D))
{
rg2d.velocity = new Vector2(speed, rg2d.velocity.y);
}
and I set the speed to 50f but the rigidbody won't move I checked the apply root motion and it is unchecked and I have this code for jumping
rg2d.velocity = new Vector2(0, jumpDist);
and it is working fine...could someone explain to me what is the problem here??
Comment
I tried that also and I faced the same problem...I don't know what am I missing
I figured it out it was my bad :D I accidentally checked the freeze position x in rigid body 2d component...I hope this helps someone out there