Keep current force applied based on Vector3.forward?
Hey, first post on here, I'm curious about how I would achieve this. What I have setup currently is a cube that moves forwards, and rotates using addforce and addtorque. What I'd like to achieve is...
View ArticleAccelerate a rigidbody towards max speed
Hey guys, I'm currently in the process of creating a naval game, and I have been trying to find a way for the ships (which have rigidbodies) to accelerate or decelerate to a certain speed. Drag will...
View ArticleAddForce strangeness: Moves properly on Y one direction, rotates the other
I am levitating a mesh transform + rigidbody with AddForce that has a kinematic rigidbody child. It moves in every direction flawlessly with the following script (I do this for X and Z as well): public...
View Articlerigidbody,addforce is affecting all clones which are clicked on through raycast
the clones of the object which are coming from the spawner also move when they are again set active in the pooling list! ( i use object pooling to generate objects from a spwner) void FixedUpdate() {...
View ArticleProblems with Raycast/AddForce on a Ball in 3D
Hey guys! I wanted to create a little football game for testing purposes, but i have a problem with the Raycast and the AddForce function. I want to detect where exactly the ball got hit and than add a...
View ArticleRigidbody addforce not working
Hi, I'm having an issue with the following code. I'm basically trying to make an AI, using 3 different actions chosen by random. The problem is that inside AIStriker(), within each case, only the...
View ArticleMario jump addforce problem
Hi, I need help with jumping like a mario. I found this solution on the Internet, but I don't like the physics of the jump because of the velocity. When changing to addforce, only a short jump works,...
View ArticleHow to make that a GameObject look with a Look At() in the opposite direction...
For example, if you increase in the "X and Y axes" that you look at a side opposite to that assigned force It is to make an oblique 2D shot for a game like the one in the image ![alt text][1] [1]:...
View ArticleApply same amount of force even after gameObjects are fixed joint
In my 2D game, OnCollisionEnter2D: void OnCollisionEnter2D(Collision2D col){ FixedJoint2D myjoint = gameObject.AddComponent(); myjoint.connectedBody = col.rigidbody; } Each gameObject have this script....
View ArticleHow long addforce applied?
Hi I thought that my answer is Time.deltatime but when I use it in below function the function output where wrong and my character jump about two times higher: public float...
View Articlesucking in particles
is there a way to make an object suck up particles within a certain range? i have a black hole i made and using a wind zone it can suck up particles within a certain range but the problem is they just...
View ArticleWould you rather set a float for thrust or increase mass for Rigidbody2D ,...
Im working on creating a 2D 1v1 cowboy dueling type game .. Just wondering for the purpose of my curiosity if its better to set thrust to a float or increase mass/gravity to compensate with the thrust...
View ArticleHow to limit rotation angle on a rigidbody2d ?
My main goal is to make the sprite lean in a certain angle while moving using Addforce basically. Considering this its not good enough just to freeze the z rotation on it in the editor . Since i need...
View ArticleApply force at angle on X axis in 3D world
Hey guys i recently started with Unity (and C#) and i am trying to pull of a specific drag and shoot mechanism. As i am figuring it out i am simply to unknown with the whole world axis and i'm not very...
View ArticleLerp to target position in X amount of time
This script is attached to a pickupable item. I want to make this Item launch toward the player's position on start (so basically when it spawns). I want the item to be launched toward the player's...
View ArticleHinge join 2d Swing by adding force to the connected rigidbody
Hello people, I have a simple game mechanic in which I use hinge joint 2d to simulate the player swinging on a rope which is attached to a Kinematic rigid body. The kinematic rigid body has the...
View Articlemove player to its rotating direction?
i want to move object to it's rotation direction like if object is rotate right side then its move in right side , if object is rotate left side then its move in left side, if object is rotate forward...
View ArticleUneven speed in 2d movement script
I have a very simple 2d game so far and im working on the movement. for some reason my a (left) is much slower than my d (right). Does anyone know why this happens? Also, should i include a...
View ArticleIs there a way to disable linear drag when falling?
So, I'm designing a platformer at the moment and to avoid the Rigidbody2D from sliding whenever I use Rigidbody2D.Addforce, I increased the linear drag. Unfortunately, this also means that when falling...
View ArticleCorrecting Directional velocity for a plane
Hi, I am trying to simulate flying, but not with 100% real physics. Now the problem I've been banging my head against the wall with is the applying velocity based on the planes direction. //Apply...
View Article