Camera Follow Code Causes Jerky Movements
I need a script that will act like the included SmoothFollow.js but will also rotate on the X and Z axes. I messed around with it and came up with this: var target : Transform; var distance = 5.0;...
View ArticleHow to make an Instantiated prefab a Child of a gameobject that already...
Hi I have a script which will Instantiate prefabs which works fine but I wanted them to be added to a gameobject that already exists and make the instantiated prefab a child of the already existing...
View ArticleMouse wheel zoom
how can i change a variable smoothly with the mouse wheel (maybe using mathf.Lerp or some kind of interpolation) I need to change the distance var. Code: var target : Transform; var distance = 10.0;...
View ArticleMetaball wiki script help
HI, I was playing around with metaballs and I tried the script on the wiki, but I ran into an issue. As the metaballs got further away from the game object they began to clip. Almost like there was a...
View Article2d Variable Types Not Highlighted
Very new to Unity here, so maybe this issue is on my end, but it's something I've noticed. When I type in variable types in Monodevelop like "Rigidbody" or "Collision" they are highlighted in green...
View ArticlePlayer Looking in Opposite Direction
Basically, if I move my reticle to the top of the screen, the player looks down and vice versa. This also applies horizontally. I am making a top down shooter. Take a look at what I mean: ![alt...
View ArticleHow to make plane rotate towards player and keep upright?
Hi, I'm trying to make my 2d plane rotate towards the player GameObject, but stay at 90 degrees on the x axis... Any idea on how to do this? I've tried a few things, but can't seem to freeze the x...
View ArticleFirst person mobile controls easy.
Okay i made a game and i want to put it on iphone. I have everything done i just need to have first person controls on the iphone. I want the like two joysticks and i know there is this thing in mobile...
View ArticleHow to access custom components from a script?
I'm trying to write a script that will allow a component to be attached to the script from the Unity editor, such as an audio clip or an animation clip. Any ideas?
View ArticleObject facing camera always in 2D game?
I'm working on 2D game and I'm trying to use the third person controller for my character but I need my character to always face the camera so he can be seen. Perhaps a modified version of the script...
View ArticleThis is my code and now how do i make the bullet shoot and how do i make it...
using UnityEngine; using System.Collections; public class NewBehaviourScript2 : MonoBehaviour { GameObject GrenadePrefab; void Update () { if(Input.GetButtonDown("Fire1")) { GameObject Grenade =...
View ArticleChanging the coordinate system
So i've started exploring a space simulation game, and I created a ship w/ a movement script, I started moving around and went out fairly far from the origin. I discovered that due to the point float...
View ArticleMath question, center of triangle that is part of a square
basically if i want to have a square whose bottom left point is 0,0 and top right is 1,1 the center of that square is .5,.5 but what if i want to have a triangle which is half that square exactly. so...
View ArticleGameObject list not refreshing in Update()?
Hello. So I've got a landscape made of blocks (sort of like Minecraft) and am trying to create a behavior where any block that isn't visible isn't rendered. To do this, I've started by getting every...
View ArticleStrange shifting when reseting player position to origin
I've been working on a script that will reset the position of the player back to the origin(0,0,0), when a certain object is touched. The object resets it's position fine at first, but then drifts...
View ArticleHow to select objects sharing the same material
So in all major 3d packages and game engines, there is a way to select all objects that share the same materials. I can't seem to find anything in Unity that would allow me to do this on a default...
View ArticleDeclaring a new Object (JS)
the following code does not work var myobj =new Object(); myobj.strength = 15; i get a long error, starting with "MissingFieldException: System.Object.strength". I am fairly proficient in my javascript...
View ArticleOdd parenthesis expectation
So I have a script #pragma strict function Update(){ var enemyStats : Stats = gameObject.GetComponent(Stats); if(Input.GetKey("space")){ function OnGUI();{ GUI.Box();{Rect(0,0,10,10); "Your mom,...
View ArticleChange connectedBody in script to Instantiate prefab
Hello. Sorry for my poor English. I have a problem that can not be solved, I hope for your help. I change **connectedBody** in SpringJoint to **null**, and it works. But when I **Instantiate** prefab...
View ArticleDeffered Shading and MSAA
Okay, maybe this is a dumb question, but here it goes. Why is it impossible incorporate MSAA into a deferred pipeline? Personally, I could think of one or two ways that this could actually be achieved,...
View Article