add force to direction
so what I have is a script that calculates the angle from the player to the mouse. It works just fine. Right is 0/360, up is 90, left is 180, down is 270. I wanted to take that angle and use it with...
View ArticleErratic Physics behaviour while testing in 2 computers
Hello I've been having some trouble testing a sorta prototype of my game in 2 different computers, in my house desktop it runs as it should (To be more specific my character moves with a rigidbody...
View ArticleCharacter instantly jumps instead of smoothly gaining altitude
Hi everyone, I'm working on a 2D sidescroller using the new 2D features from 4.3. To start off, I created a player movement script that uses the 4.3 [workflow demo][1] as a base. I've copied their jump...
View ArticlePhysics in 2D mode not working?
I have a ball that I want to simulate with 2D physics to bounce around when dropped, but I have a problem. If i just add a rigidbody2D to the sprite it just starts to float up. If I try to add any...
View ArticleHow to make a gameobject with rigidbody2D fly through the air?
After I instantiate an object I want it to go flying through the air. I think I'm supposed to use Rigidbody2D.Addforce but I want to launch the object at an angle and so that it "flies through the air"...
View Articleaddforce question for android?
I'm doing an addforce to a gameobject that is directly controlled by my character controller as well as a target gameobject that works with the same code or similar. I have also added a debug dot...
View ArticleHow do I make a cube fly along a single axis.
In my game I am trying to make it so that when a cube hits a player the player gets knocked off the platform. I have looked at a few ways to do this but I would like to try and use the...
View ArticleHow to slow or stop an object with no gravity
I have a space ship which gets it movement from addRelativeForce when the verticle axis is pressed. The thing I'd like it to do is slow or stop the ship when the user stops pressing the move button. Is...
View ArticleInstantiate a Gameobject and AddForce to it (Rigidbody2D)
I need to instantiate a GameObject at certain intervals from an empty gameobject called spawnpoint and add force to the instantiated object. With the script that I have written the initiated gameobject...
View Articlerigidbody2D.AddForce() to a character gives jerky motion
Hi all, I am adding the force to a simple sprite having rigidbody2d component. Sprite mass is 1, gravity scale is 1. I don't have too much of code and no such BG's just a simple ground and a character...
View ArticleAddForce adding together on 2 button presses
I've been making a platformer for some time, and the player can both jump and have an upwards force applied so the player can hover. However, when I press jump, then immediately press gravity, the...
View ArticleAdd Force based on Raycast
Hi again, I really could use some help with this script. An error saying : UnityException: You are not allowed to call this function when declaring a variable. Move it to the line after without a...
View ArticleAddforce more powerfull in the air than on ground
Hello! I currently working on some rocket cars and I have come up to an annoying problem. I have cars and ground with a physical material with **0** friction (the car just floats around when adding...
View ArticlePool Ball AddForce And Point Problem
![alt text][1] [1]: /storage/temp/19494-pool.jpg Hi developers, I am developing pool game and have problem. This is my ball script code little part if ( Physics.Raycast(mousePosition, out hit) ) {...
View ArticleRigidbody.AddForce 2d movement without acceleration
I finally have movement working well enough in a game using a Rigidbody and the AddForce function, but I need to have no acceleration or deceleration. Adjusting the drag to a really high number doesn't...
View ArticleHow to add forward velocity to a Rigidbody2D?
I can't seem to figure out how to do this. I've checked the documentation, but it doesn't really explain how to do it. This is the script I'm using right now: var speed : int = 10; function Update () {...
View Article[Solved] How to shoot an object in front of the player?
I've wrote a script for my firstperson game which parents a football in front of the player. My aim is to shoot the ball in front of the player if i press the left Mousebutton and hold down the "W"...
View ArticleAdd force to Instantiated object.
Hello, I am trying to add force to shoot a bullet I've Instantiated at the gun of my player. When I run the code the bullet just slowly floats up. If I add force to the bullet in it's own script it...
View ArticleWhen is AddForce actually applied ?
So i have the following code to make a rigidbody move: void Update() { inputVector.x = Input.GetAxis("Horizontal") * acceleration * rigidbody.mass * Time.deltaTime; inputVector.y =...
View ArticleHaving a parent object follow a child collider with rigidbody during AddForce()
Hi, I have a parent object which contains an arrow sprite and a child object which contains a collider and rigidbody for the tip of the arrow. The reason I added the collider as a child is because I...
View Article