Quantcast
Channel: Questions in topic: "addforce"
Browsing all 1264 articles
Browse latest View live
↧

Is it possible that colliders can be run through which too much force?

I execute an rigidbody.addforce(transform.forward * 5000) and this object runs right through a collider. How do I prevent this? I want the speed with which the addforce does. TIA.

View Article


Rigid body not moving

When I disable the rigid body and use transform instead it moves fine. I have tried turning kinematic on/off and it doesn't make a difference. When I play the scene my character drops showing that it...

View Article


AddForce moves my char to fast up

Hey, I'm creating a 2D game. I have done my charController, but I ran into a problem. For my jump funktion I am using AddForce. When I am jumping, my char jumps to fast up. I know that I can setup how...

View Article

AddForce applies different amount on Android than PC

My player jumps much higher on android device, than it does on PC. Here is my Jump code for my player: public void jump(){ if(gScript.getJumpCount() < 2){ rigidbody.AddForce...

View Article

Help on Player Movement Script C#

Hi, I'm having some difficulties with moving script. Wanted behavior is that Player object can move in all directions, and gravity is 0. Also speed of the object should decrease slowly, so I tried to...

View Article


calculate time to reach a target of rolling rigidbody sphere

Hi all, This is a physics and maths question. I have a sphere rigidbody that rolls along the floor towards a target when I apply a force. And I would like to calculate the time (in seconds) it take for...

View Article

Add Force to the right of the rigidbody, not right of the screen

Using addforce to a rigidbody with vector3.right causes it to move right, even if it is rotated. My question is, how can you get the rigidbody to move from its angle. For example: ![alt text][1] and...

View Article

Player isn't moving (AddForce) (Hook)(c#)

I created a little script that shoots simple spheres as hook. When the hook hits something, it stop moving. And now the player should get pulled to the "hook", but nothing happens... Here is the Code,...

View Article


rigidbody2D.AddForce() not working on iPhone

I tried the following line of code in both Update() and FixedUpdate() rigidbody2D.AddForce(new Vector2(0, 1000)); This works fine on my PC and Mac builds, but when I put it on my iPhone is does not...

View Article


Rigidbody-based spaceship?

Hello! I am working on a unique racing game set inside anti-gravity tunnels. My player can yaw with the "horizontal axis" and pitch with the "vertical axis". The player accelerates in the direction...

View Article

Addforce to gameobject i am colliding with

Hey i want to add force to instead of this.gameObject something like that.gameObject . So i add force to the gameobject that is tagged as box if i collide with it. feel free to clean the code if there...

View Article

Shoot logic, bullet instantiation

Hey ! I'm having a issue when I want to instantiate a bullet going from my gun and to infinity. The bullet gets the right rotation from the code, but not the right force added. Can anyone help me out ?...

View Article

How to apply knockback on collision (2D)

Here is the code for my player movement: function Update () { animator.SetInteger("Direction", 4); if (Input.GetKey(moveUp) && isGrounded == 0) { rigidbody2D.velocity.y = jumpheight; isGrounded...

View Article


Not understanding how rigidbody2D.AddForce works

I know this has been asked before but I'm not able to find any answer that's not too technical or vague for me (I'm really new to coding). I'm creating an Asteroids-like space shooter using Unity's 2D...

View Article

Rididbody movement at the end of a rotating platform

![alt text][1] The blue block is my player. The green block is the goal. I am using a rigidbody and adding force to make the player move. If the players velocity.magnitude is less than maxSpeed then...

View Article


AddForce makes cube

Okay - so I have got a problem with addForce. At the moment my character is a cube which is moving around in a 3-dimensional space. However when it is on the floor it starts to roll instead of slide. I...

View Article

Force on one axis only

Hello, I have a moving rigidbody and I want to apply force to only one axis of it. If I use the AddForce, then it just "adds" up the force and not completely resets old one and applies the new one. Any...

View Article


Force on one axis only?

I have a paddle(platform) like in breakout/arkanoid game, and once a ball hits in a specific location(left/right) then I want to have ball move with certain force on X axis. This code is working...

View Article

rigidbody2d addforce for moving gameObject not work

Hi everyone. My english is bad, but I will try to tell you about my problem. Code (C#): void FixedUpdate () { on_tram = Physics2D.Linecast (on_tram_left.position, on_tram_right.position, 1<<...

View Article

Foces only change during collision

I am trying to control a cube with the keyboard inputs. I want to change the acceleration of the cube while it is in the air, but the applied forces will only update during a collision or if I set the...

View Article
Browsing all 1264 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>