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

How to get an x, y direction/vector from a z rotation c# 2D

Hello.... I have an aimer object which rotates around the z axis to "point" at where the mouse is on the xy plane (2D). The aimer object is a child of the player object. there is a firepoint object...

View Article


[Solved]Why doesn't this Rigidbody.AddForce work the way I tell it to?

Ok so I have this space ship that has thrusters at the front to control its direction by applying a force from the specific position of the thruster using Rigidbody.AddForceAtPosition. However I can...

View Article


`Inventory' does not contain a definition for `Add'

Pls Does anyone help me? Assets/Script/Inventory.cs(13,27): error CS0117: `Inventory' does not contain a definition for `Add' Script : using System.Collections; using UnityEngine; using...

View Article

Another alternative of rigidbody.AddForce?

Hi! I was just about to release my game when I noticed something BAAAAD. While using rigidbody.AddForce on my player, I noticed that the higher the FPS is, the faster the player goes. So players with...

View Article

When I add force to rigidbody it doesn't keep it location

I am working on making the character do a sort of run up the wall when the player holds the left control button. I can get the character to move up, but there are a few issues. Firstly, it is quite...

View Article


Animator and Rigidbody2D Conflicting. Help~

Hi guys and ladies, So i've got a character set up using a hierarchy of sprites and a simple IK script attached to it. at the top of the hierarchy, i've got an empty gameobject which i've added...

View Article

RigidBody falls through the ground

I'm working on some swimming physics. I made a script in C# that is applying weak downward force (gravity in water). The script is enabled everytime player is below sea level. When I start the game...

View Article

Allowing an object to bounce off walls only when certain forces are applied

I’m currently using rigidbodies and Forces to control the main character in my game. There are two types of forces that can affect the character: When the player uses the ASDW keys to control the...

View Article


Difference and uses of rigidbody force modes ?

Hi, i have recently been working on physics bases grapple hook, mostly used just to pull the player in with optional forces added to sides. anyway i would like to know what is the difference between...

View Article


How can I add Force to my object with gravity so that It can travel to Long...

I am new In Unity and I am Developing one Simple game where Plates are Initiate from One place and It will Destroy on click. I want to show my plate flying from one place to another place with Gravity....

View Article

transform.forward.speed not working?

im wanting an object(bullet) to spawn and go at a certain speed straight away. i have a variable and im using rigidbidy.addforce(transform.forward * speed); speed is my variable. it works fine when i...

View Article

Avoid incoming objects by aproach side

have this code that detect objects to be close to my GO, but i want it to detect which side of the object is aproaching to add the right side force to it: void Update() { GameObject[] Bullets; Bullets...

View Article

Add a force to a ball using the Boxcolliders AXIS

Hello, im pretty new to this, I have googled and tried so many ways, but I cant figure it out. This is the code I have: function OnTriggerEnter (other : Collider) { ball = GameObject.FindWithTag...

View Article


adding a force to a dice and find out which face collided with the ground

I'm having trouble adding strength to a dice and make him go forward and then after a certain time. And also like to know what was the face that is glued to the floor in order to then pin down the...

View Article

Destroy object on collision or check position

In the scenario where multiple `rigidBody`s moving due to `addForce` goes out of view (say, top of view) and is no longer needed then what technique should be prefered? 1. Destroying the `gameObject`...

View Article


Why does writing to rigidbody.velocity after AddForce stop my rigidbody moving?

I've not spotted this issue documented, so hoping someone can help out. My aim: 1. Add input force 'correctly' to my rigidbody (via AddForce) 2. Adjust the rigidbody velocity to stop it going too fast...

View Article

Add extra movement to an animation

Hello, I'm making a third person character controller, and currently I'm working on the strafing: Basically what I want to do is to be able to move forwards and backwards while playing an animation...

View Article


Rigidybody2D addforce at constant speed

Attempting an infinite 2d runner, but when I use rigibody2D.addforce it slowly accelerates to insanely fast regardless of what I multiply it by... enter code here#pragma strict var myForce : float =...

View Article

How would I reduce jittering on this RigidBody2D?

So I have this code where it does what I want by moving the player behind the mouse and having a variable speed depending on how far away it is from the cursor, but it jitters a lot. I don't understand...

View Article

Mathf.SmoothDamp gives weird values

Hello, I am calculating smoothed change of the speed for my spawning objects. They move towards my player and there is an impression that player falls through a pipe sort of. There are obstacles and...

View Article
Browsing all 1264 articles
Browse latest View live