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

How to have a cube to fall on fixed rotation?

Hello all, I'm having a cube in my scene with a rigidbody and I want the player to click the cube, the cube will jump, rotate in the air, fall down to fixed position. This is the script I use: void...

View Article


How am I able to move my (Player) character in the opposite direction of...

I want my player to move by shooting. Meaning that you get knocked back towards the opposite direction of where you're aiming and shooting. I am using this script to aim and shoot: public GameObject...

View Article


AddForce moving object in wrong direction

So, I ran into a problem with using physics, which is always something that seems to bring up problems. I have a simple 2d scene with a player that can move left and right, and an enemy object that...

View Article

why does my addforce only last for a split second?

im very new to coding so sry if this is a simple mistake. ive set up my cube to move in any direction but for some reason whenever i press a button to move i move in the direction i pressed but only...

View Article

Enemy AI 2D not working? ( Rigidbody.Addforce() )

Having trouble getting the enemy ai to chase the character with rigidbody.addforce(). So far it seems to be sliding around the player like its on roller skates and eventually hitting it. I changed it...

View Article


Spawned objects won't stop moving after instantiating. 2D Top-Down

![][1] [1]: /storage/temp/137540-spawn.png void SpawnCoins() { for (int i = 0; i < coinDrops; ++i) //Spawns an amount of coins { GameObject coin = Instantiate(coinPrefab, transform.position,...

View Article

Inconsistent AddForce results

Hey there, I am trying to implement a pushback effect as seen here: https://youtu.be/v2uOGQegj2c?t=270 When a projectile hits a player, the player is pushed back in a direction relative to the hit...

View Article

Any way to add force to an instantiated object?

So I wanna shoot a bullet and add force to it when I instatiate it instead of making it fly upwards by itself. I have this script and it doesnt make the bullet fly upwards (a classic 2d space rocket...

View Article


How to change the direction of a rigidbody without adding to its speed?

I am a newbie trying to making a soccer game with Unity3D. The ball has a rigidbody attached and is moved using AddForce. I have added a ‘swerve’ effect to the ball by enabling the user to AddForce to...

View Article


How to make function respond to only the initial touch position.

In this game what I'm trying to accomplish is a sprite that rotates towards the touch position (which I have done) and have knock-back. The problem i have run into now is that it rotates if you hold...

View Article

Addforce lasting 1 frame

Edit: (My rigid body settings are as follows - mass = 1 drag = 0 angular drag = 0.05 gravity = yes is kinematic = no interpolate = none collision detection = discrete only constraints on all rotations)...

View Article

Moving Rigidbody in fixed update

Hi, So RB should be moved in FixedUpdate. Is this the case whether it is moved by AddForce, or MovePosition, or both? My RB is following a NavMesh waypoint path. What I'm trying to do is move my RB a...

View Article

How to do big jump when holding touch on mobile?

I searched it but couldn't find the complete solution to this. I am new to Unity so if you could provide with the coding then it would be really helpful. I want to jump and touch the screen and do a...

View Article


Copy object Movement/Addforce on Trigger to other object,Copy object...

Hey Everyone, I'm building a 2D game and using the physics but I'm having trouble with making a surface that holds a object/player(C) in a areaplatform(B+D), the areaplatform(B+D) is being pushed by a...

View Article

Moving the player in a ballistic trajectory in 3D

Hi! I'm currently struggling with this issue for about two weeks and can't seem to get the hang of it. Here's the premise: I want to create a 3D platformer where one of the player's abilities is to...

View Article


Can you add a force to a rigidbody at an angle?

Hi! I am making a game where you control a sphere by adding forces to the rigidbody of said sphere. To accomplish that I would like to be able to add a force to the rigidbody around the y axis of...

View Article

Problems with velocity

Im trying to get an object to return to the player by adding velocity to it to return it. the problem is that when I apply the velocity to the object, it applies that force to the player as well as the...

View Article


Add force on the ball based in Mouse Drag

Hey guys, How can i add force on a ball based on mouse drag. I am trying to build a golf game in 3D, [like this](https://play.google.com/store/apps/details?id=games.onebutton.golfbattle&hl=en_IN)...

View Article

Rigidbody falling very slow

I added a rigidbody to my tank player, but now, even when I disable the moving script, the rigidbody falls SYRUP slow. What is happening? (Here is the code that I commented out) using...

View Article

rigidbody velocity on x axis and addforce on y axis ??

how can i make my object can use rigidbody velocity on x axis and addforce on y axis, i want to move my character with velocity and make jump and gravity with addforce, i try : vector3 forced = new...

View Article
Browsing all 1264 articles
Browse latest View live


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