How to add a velocity limit to an object with rigibody addforce?
Hello, community! Currently, I´m facing a challenge. I am working on a mobile game in which I move the player with in-game joystick system. The problem is that the player is too fast if the drag of the...
View ArticlePlayer Vibration on collision - AddForce Vs transform.Translate
Hello so ive been trying to make a player controller, everything is good but when the player collides with a 2d Collider he vibrates into it, i understand that its because transform.Translate teleports...
View ArticleMake Enemy Shoot At Specific Location?
Hello, I'm trying to do a ship that is always rotating following the player , and that shoots him. I Instantiate the bullet and get the player position (all that works). Then I use AddForce...
View ArticlePc controls to mobile controls
So im going to start of by saying that im a noob at programming. This is my first so I dont have a lot of knowledge at programming. So I made the game first for PC, and now that im done, i want to make...
View ArticlePc controls to mobile controls
So i want to start of by saying that im a noob at programming. This is my first game so i dont have a lot of knowledge about programming. So i first made this game for Pc, and now that im done, i want...
View ArticleAddForce 2D it's not working
I'm Instantiating an object and trying do add a force to it, I've tried a lot of ways but It's not working void Update () { float eixoX = Input.GetAxis("Horizontal"); Vector3 direcao = new...
View ArticleImpulse force time
Ok, I couldn't formulate this question simple enough to google it effectively, so I hope I can get some help here. I have an object that I add force to using [Rigidbody2D.AddForce][1] with...
View ArticleProblem with when turning left with angling and the force of the projectile
Hello Unity I recently picked up Unity and already stumped upon an issue. My project is a 2.5D with the background and platforms being 3D and everything else in 2D. So far I've been able to flip both...
View ArticleHow I can do knockback without OnColisson or OnTrigger
I want my player to have knockback when my enemy hits him but I do not want to use OnTrigger or OnCollision ,I want my player to have knockback when my enemy hits him but I do not want to use OnTrigger...
View ArticleRemoving velocity in Z direction ,Stopping a player's velocity in Z direction
Hi, i just made my first game using Unity which was a lot of fun X). Because i'm really new to C# I really have no idea how to code by myself and needed some help. So this is the script that im using...
View ArticleHow to set the velocity in Z direction to 0?
Hi, i just made my first game using Unity which was a lot of fun X). Because i'm really new to C# I really have no idea how to code by myself and needed some help. So this is the script that im using...
View ArticleDetermining how much force to add to reach a certain velocity in a certain...
So I am working on a 2D player controller with a few things I want to be able to do. Move left and right, jump multiple times, slide down walls and wall jump. Because I want to be able to wall jump I...
View ArticleAddForce to mouse position
void FixedUpdate() { var mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); var mouseDir = mousePos - gameObject.transform.position; mouseDir.z = 0.0f; mouseDir = mouseDir.normalized; if...
View ArticleError when trying to get an object to be pushed when shot by a bullet.
Hey i want to make a game where you try to shoot your friends / enemies off a pillar by pushing the players when they get shot. When using this code i get the error: > NullReferenceException:...
View ArticleHow to AddForce to a GameObject with Touch
Here's my funtion : public float sideforce = 80f; void FixedUpdate() { if (Input.GetKey("a")) // Ball Turns Left { rb.AddForce(-sideforce * Time.deltaTime, 0, 0, ForceMode.VelocityChange); } if...
View ArticleUnexpected behavior from bouncing sphere
Hi, I'm playing around with some physics in unity. I've created a sphere and I am using the AddForce on it to move it along the x and y axis like so: void Start () { position = transform.position; ball...
View ArticleAddforce doesn't work!
I have a player moved by transform.translate. I need the player to knock back when it is hit by an enemy and I'm using Addforce for this but it isn't working. Here's the script. Thank you! public float...
View ArticleConvert transform.position to Force
Hey so I am making a tornado that picks up objects and rotates them around. It works nicely but i would like to use Forces, rather than transform.position. So i was wondering how i could convert this...
View ArticleRotation with rigidbody2d.AddForce() ?
Hey dear experts, I want to spawn a little drop by a specific occasion. However the drop feels kinda static, so I want it to change its rotation matching to the force applied. Is there a way to achieve...
View ArticleAdding force to a rotating wheel using mouse or finger drag.
I have a wheel that I am currently try to add a force or torque to after a mouse/finger drag. Think of it as a wheel of fortune that can be spun in any direction. I have six nodes on the outside of my...
View Article