Calculate jumptime
Hey I'm trying to programm a simple 2D game where the player is a square. When he jumps i want to make him rotate. For this i want to calcualte the jump time. To let him jump i use addForce. I found a...
View ArticleHow to AddForce to a Rigidbody from Game Objects Spawned from an Array, One...
Hello. As the question say, I need to add force to a prefabs that are spawned from an array, and they need to be added to the prefab one at a time. Let's say there's an array of 10 prefabs that are...
View ArticleRigidBody2D velocity randomly drops to zero
I'm using a rigibody2D on a cube in Unity. I have a constant force been added to slowly increase the speed and couple of ifs to cap it out if max speed is reached. This works but every now and then...
View Articlelet rigidbody idle around in space
hey! i am working on a low gravity game: http://pixelpizza.de/wordpress/?p=606 and what i want to do is, that my rigidbody chracter is "ideling" a little bit around. so that means that he pushes...
View ArticleRotate a hing Joint on its owen
Hello everyone ! So I wish to simulate a bat hitting a ball falling from above , Therefore created in photoshop every part of the hitting motion and because animation in Unity is Collide-Less i figured...
View Articlecreate a cannon ball based on cannon angles and cannon power
I am trying to make a 3d version of a game I made long ago with a different program. the game requires a cannon to fire cannon balls at a castle. since I am working with a new program and working in 3d...
View ArticleAddForce changes behavior based om location.
I'm trying to make an enemy jump toward its target to attack using AddForce. but just how much force is added seems to depend greatly on where in the scene the entities are (see video:...
View ArticleImpulse not applied when animator is enabled
I have two humanoid avatars, to which I attached Jump.cs which applies an impulse on specific events. It works fine on one of the avatars, even if animator is enabled. On the other one jump is only...
View ArticleHow to make an object move in an arch
Im trying to make a cannon, im making the cannonball move with Rigidbody.Addforce(Vector3.back * speed). i have been constantly messing with the speed variable and the mass for the cannonball, but i...
View ArticleHow to move an Instantiated Object towards a moving Object?
Hello, I can't assign a "target" to the followtheplayer script because it only accepts Prefabs which don't change their position and thusly the Instantiated object just goes to 0, 0, 0 where the player...
View ArticleAddForce always pushes down
I'm trying to get my bearings around unity regarding the physics and AddForce doesnt behave as i'm expecting it to... using UnityEngine; using System.Collections; using System; public class...
View ArticleAdding force to a specific (non-child) object (2D, C#)
So what I am trying to achieve is to have an enemy touch the player and then add force to my players "hat", making it fly off of his head. The way I have my code set up is for the hat to follow a...
View ArticleHaving trouble adding force to a child object
I am trying to get the child object "hatWaypoint" to move using an OnTriggerEnter script on the parent object. This is what I have thus far: private void OnTriggerEnter2D(Collider2D thing) { GameObject...
View ArticleAddForce and Momentum
Hi guys. I have a problem with the Physics Engine. Few days ago I started working with Physics, so maybe this is a stupid question. I have a drone, with different gameobjects as children, rotor 1,...
View Articleleft force right force
![alt text][1] I want to apply force as the picture probably I use AddForceAtPosition but I dont use help me ? [1]: /storage/temp/60897-gorsel.png
View ArticleKick a Ball - Add Force?
Hey! So I am working on this football game: http://pixelpizza.de/wordpress/?p=297 and currently i am stuck at the "kick a Ball" part. kicking works great so far and looks like this:...
View ArticleWalking around objects
So i had an idea of a game where you have to survive on a small planet and this planet is a sphere so i walk my player to be able to walk around the sphere without falling off. i basically am trying to...
View ArticleAdd force with acceleration
alright so i need a physics script or a video on how to do this but how do i make it so when the player jumps on lets say a platform at a straight 45 degree angle ( like a slash / ) he sticks to the...
View ArticleEnemy watches player and shoots but bullets will not project
So I am pretty happy with how well this script works, despite it’s one issue. This is a 2D topdown game and this script makes an object continuously rotate on a spot to always be facing the player, and...
View ArticleBall Speed is not increasing as per code
I am working on small project , but now I have a problem . The problem is The Player speed (Ball speed) is not increasing as per the code . In the beginning ball speed increases , but as the time goes...
View Article