Declaring myRigidbody
I so far have this script to make my monster move but it says that there is an unknown identifier "myRigidbody". #pragma strict var target : Transform; var moveSpeed = 240; var rotationSpeed = 180; var...
View ArticleAddForce not working
I am currently using this script to make a monster chase the player: #pragma strict var target : Transform; var moveSpeed = 240; var rotationSpeed = 180; var myTransform : Transform; var myRigidbody :...
View ArticleRigidbody2d addforce is weaker at a higher y position.
When my player object jumps on a higher terrain, it doesn't jump nearly as high. Here's my jump code. #pragma strict var BounceObj : GameObject; var jumpHeight : float; function Start () { } function...
View ArticleMovement Relative to both Camera and XZ Plane
I have simple movement set up with a sphere object using a Mouse Orbit style camera and Rigidbody.AddForce(). The main issue is that I want it to move in the direction the camera is facing but only...
View ArticlePerformance of FAN/Wind objects
So right now, I am using an invisible shotgun of sorts to create "wind" from fans. NOt so great on performance though, as it requires MANY shots,e ach with small mass to accomplish this. What I want to...
View ArticleHow to stop adding torque and force when object collides with collider (or...
Hi, I use the following script to ping a coin from a monster when it dies, however, the prefab keeps spinning and moving on the floor. How can I make it stop one it has collided with something? using...
View ArticleHow to gradualy decrease all rigidbody added forces?
I am beginner and 3d artist! I making **Space Shooter game** in JavaScript with camera from bird-view, spaceship can turn around **with "AddForce" floating freely in space** and i want to **decrease...
View ArticleCharacter Controller
I have a character controller, and I wan't it to launch in the direction of the camera, kinda like "Rigidbody.AddForce" but, I can't use a rigid body controller, because it stops the forward...
View ArticleMake a player jump tile
Hey guys, What I have is a player that constantly moves forward. When the screen is touched, all of the tiles that are jump tiles respond. The regular tiles do nothing. What happens is that on a jump...
View ArticleRigidbody2D AddForce towards object
So I have a rigidbody2D component attached to my player. I have the player attach and detach to these rails I am trying to build. While on the rails I have the controls switch from the default WASD...
View ArticleHow to add opposite force of current direction?
I making Space shooter game, camera looking from bird view, my space ship turning around and goes in all direction by AddForce fucntion. i want to add braking sistem to decresing addforce in current...
View ArticleContinuous movement with AddForce.
I am attempting to move a cube continuously on screen. I have put up my code and I just don't know why it is not updating through each frame. Thank you! void Start () { _moveDirection = Vector3.back;...
View ArticleMoving player to the opposite direction where the mouse is
Hello, I've been trying to make it so that my player gets propelled to the opposite direction to where the user makes a mouse click. The following code was applied to the player. I can't get it to work...
View ArticleJump off the edge of the object
Working on runner. Character stands in place and just jumping. Character jumping: if (jump) { dir.y = jumpSpeed; } dir.y -= gravity; rigidbody.AddForce (dir * speed); Main problem is jump height on the...
View ArticleMoving player to the opposite direction of the mouse position
I've already tried to ask this question some days ago but nobody has answered yet, I'll try to ask this again in hope that anyone could help me. Hello, I've been trying to make it so that my player...
View Articlerigidbody2D.AddForce() not working
using UnityEngine; using System.Collections; public class RocketScript : MonoBehaviour { public Vector2 speed = new Vector2(0, 20); public Vector2 downspeed = new Vector2(0, -20); // Use this for...
View ArticleAdding force to a 2d object in specified direction not working?
So I have this boss, it's supposed to punch the player in the direction the boss is facing, like a knockback. This wont work though, I cant figure out why. Any ideas or tips? Also I know its a very...
View ArticleRecieving a nullpointerexception while following the Unity Instantiation...
I am coding this in C#, and I ran into this issue while coding a simple script to shoot a ball from inside of my character. I have figured out it is coming from the AddForce function after casting as a...
View Articlehow to control gravity for addforce ?
So i just wanna know how i could go about controlling the gravity for the rigidbodys addforce function ? like when i jump the player reaches the end of his jump and like floats for maybe 0.2 seconds,...
View ArticleTrying to make a bounce platform that tosses the player.
I want to make a bounce platform. I tried to figure it out myself but no luck. I got it to work somewhat, but for some reason it would only work if I entered the trigger from the left side. So after...
View Article