how to make "addForce" only affect one of several connected objects (with...
I explain: I have a "stickman" made up of several parts joined by Hinge joints. What happens is that when I move the arms or feet of the doll using addforce, the whole body is affected. What I am...
View ArticleHow to check fo rigidbody collision?
I am trying to make a boost/bounce pad script, but right now it only supports the player, and not any props. all of my props have rigidbodies, prop tags and prop layers. I have tried everything i...
View Articlei couldnt make my object jump.,i couldn't make my object jump
when player doubletap on screen i want my object jump. i tried 3 different code but object doesnt jump. Is anyone can tell me why? I wrote code in lateupdate. i put debug.log and its working in same...
View ArticleCreating a prefab and moving in a random direction - coin fountain burst
I'm trying to create a coin fountain burst. I saw several people asking questions related to this but I can't seem to get it to work. What I've done is: public void CreateCoinBurst() { for (int i = 0;...
View ArticleHow to constantly add force to my player when a button is hold?
Hi, I want to constantly add force to my player when a button is hold. The problem is that force is added only once (when i click), but I want to keep adding force as long as the button is hold.
View ArticleAddForce by Touch speed problem (Solved)
Hello, this is my first question. I hope I am asking correctly. I have a game project that throws a ball with a touch screen. The speed of the ball depends on the time you touch the screen. And its...
View ArticleRigibody Velocity Wont Work?
Hello! I want my boss enemy to spawn knifes, that fly in the air and fall to the ground. The thing is, that nothing I do to add force, my knifes still just drop to the floor. They get instantiated once...
View ArticleHow to use a line to aim in Unity3D?
I have this GameObject upon which I click and addForce for it to move, as if I was flicking it. For now it only moves forward. I want to visually aid the player by introducing a line which allows him...
View ArticleI'm so lost trying to add a force towards the nearest collder with tag "x"
**I want my player to be able to get an impulse towards the nearest gameobject with a specific tag**, I'm a bit new to unity so probably parts of my code are no-sense, **I know that I have to put all...
View ArticleAddForce() in axis x and y not working
Good people! I'm trying to apply force to my player when it collides with an enemy. As well as this the code does not work. But if like this, in AddForce I change Vector2.left and Vector.Right, both...
View ArticleAddforce function for an Instantiated object is not working after slow motion...
I have a code block like below, Basically I am trying to instantiate an object(asteroid) and add force to it. Everything works very fine. But in another script I detect the collision and I gave slow...
View ArticleAddForce Jump Problem
Hi there! I am new to Unity, and I have the following script to control my character, but I am having a problem making him jump. He plays the animation when I click space, but not actually gaining any...
View ArticleInconsistent jump height
So I am working on a 2D platformer game on Android. At the start, my character jumps normally but whenever the score reaches about to 20 (the score is based on time) my character seems to be jumping...
View ArticleInconsistent jump height
So I am working on a 2D platformer game on Android. At the start, my character jumps normally but whenever the score reaches about to 20 (the score is based on time) my character seems to be jumping...
View ArticleTop Down Movement with AddForce()
I'm making a top down shooter. To make the enemies (and player) move I use the MovePosition function. When a bullet hits an enemy it pushes the enemy using AddForce. The problem is: this force is...
View ArticleIM NEW,MY OBJECT WONT MOVE :(
public class movement : MonoBehaviour { Rigidbody rb; public void Start() { rb = GetComponent(); } public void Update() { } public void fixedUpdate() { if (Input.GetKey("w")) { rb.AddForce(new...
View ArticleCan't add AddForce or velocity to RigidBody2D
Hello everyone, I'm trying to get the player knockback when touching an enemy. Everything works fine, but when I try to apply force to the player nothing happens. Does anyone know what the problem...
View ArticleHow to set rigidbody force
Is there a way to set the force on an object in rigidbody2d, currently I'm using this but the speed constantly accelerates and decelerates. void FixedUpdate() { if (direction.magnitude != 0) {...
View ArticleRigidbody2D.AddForce teleports player
![![alt text][1]][1]I'm making a topDown shooting game and I want to add an explosion. I use addforce to do the explosion push, and it works, except for the player. The player just teleports intead of...
View ArticleIs there a way to "rotate" the direction of addForce (without using...
Trying to word this best I can. say I add this to a rigidbody object: Vector3 dir = new Vector3(1, 0, 1); rigidBody.addForce(dir); From a top-down perspective, this will push the object up-right (in...
View Article