Quantcast
Channel: Latest Questions by Crispinator
Browsing latest articles
Browse All 30 View Live

Error : Expressions in statements must only be executed for their side effects.

I am trying to create a menu. I don't see what I am doing wrong. Here is my script. I am not worried about the resume section yet though. function Start () { } function OnGUI() {...

View Article



Destroying Multiple Objects with Tags

I am trying to destroy a grid when a button is pressed. Each grid square is a child of one other one. This script is attached to the button. #pragma strict function OnMouseEnter () {...

View Article

How to make a Multiplayer Game?

I understand that this is incredibly time consuming and difficult. I would like to learn how to create a multiplayer fps game in Unity. I need a place to start. I would like any recommendations on...

View Article

How do I get an NPC to stop Following a player based on distance?

I have a wolf. The wolf follows the player because of the tag. For some reason, when I add the section of code about distance, the wolf doesn't move. var target : Transform; var moveSpeed = 3; var...

View Article

Changing tagged objects in script

Hello everyone! I would like for multiple objects tags to be changed when I click a separate object. For some reason it won't work #pragma strict function OnMouseUp () { var weapon =...

View Article


Adjusting Rotation of Instantiated Objects

I have a sword in a game. When you click on the sword, it deletes and creates another one in your hand. It does this correctly but with a random rotation. How do I fix this? #pragma strict var hand :...

View Article

Changing tags of an Object and its Child

I want the sword object and all of its children to change tags, but for some reason it won't work. It's probably some obvious problem and I just don't see it. function OnMouseUp() { var sword =...

View Article

Creating a Loadout

I am trying to make a "select a class" system like in Chivalry or Call of Duty. For some reason the first instantiate line will work and he rest won't. The one that says, "var LongswordShortsword" is...

View Article


Scoring System

I have been looking at this script for hours and have gotten nowhere. I have two scripts. One manages the score ad is on the gameManager. The second is on the enemy. I cannot figure out what is wrong....

View Article


Saving Highscore

I have code that calculates score based on distance. How would I go about getting this code to remember the high score after the game is quit? Thanks in advance. #pragma strict var player : Transform;...

View Article

Getting Information from Web Pages

I have just started working on a project and need a way to get information from websites that I did not create. For example, if I wanted to take the price of a product off of a separate companies...

View Article

Divisible by 3

I need to take an int variable that that will never be the same number, and check to see if it is divisible by 3. If it is not, I need to find the nearest number that is. Any suggestions?

View Article

Make an Object teleport a Random distance away.

I need an object to teleport a random x distance between two numbers, and a random y distance between two numbers. Any suggestions?

View Article


Adding Props to Animations

I have a character that is animated. He runs forward, back and can strafe left and right. I attached a sword in his hand. The sword is a child of the hand model. While the sword does stay in the same...

View Article

Homing Missiles that target where you were

I have a code that is on a prefab of a missile that is created by a separate object. Its position is then controlled by this code. I'd like the missile to lock onto the player's position when the...

View Article


Choose a Random Tag

Basically, I have five GameObjects each with a tag that is a number between 1 and 5. I'm trying to set the tagNumber integer = a random integer between 1 and 5. Then, I want it to set the target...

View Article
Browsing latest articles
Browse All 30 View Live




Latest Images