Quantcast
Channel: Questions in topic: "write-my-code"
Browsing all 92 articles
Browse latest View live

How do I spawn a random prefab?

I want to spawn a random prefab from my list. The prefabs are players such as a Ninja or a Cyborg. So when the game starts, a player prefab from my list is spawn that the player can control. So every...

View Article



Adding stamina to existing script

I found a script that adds sprinting, crouching, etc to CharacterMotor.js. Now i'm trying to add a stamina bar and am having difficulty. **sprint.js** var walkSpeed: float = 8; var crchSpeed: float =...

View Article

Melee Attack

I'm trying to make a melee attack so I put rigidbodies(iskinematic) to object and sword. I also added coliders but the problem is sword may touch the collider when the character moves a bit without...

View Article

i cant seem to clamp or smooth the rotateTouchPad could someone help me out?

#pragma strict @script RequireComponent( CharacterController ) @script AddComponentMenu("Camera-Control/Smooth Look At") private var character : CharacterController; private var thisTransform :...

View Article

Creating a list of buttons that can be scrolled left and right?

Hi all, I have to create the left and right arrows which can be clicked to scroll through a list of menu options. The list should be clickable buttons. Per button click I want to scroll one item in...

View Article


Smooth Slow Motion

I was wondering how I would make a slow motion C# script,(I'm new to unity lol) That would still be smooth, but still have accurate and smooth physics.

View Article

I'm not a very good coder but I was wondering if someone can write me a...

So basically I need a script where if "Person" collides with "Dead body" they will look for the player

View Article

2d camera scrolling

Hey I'm new to unity and I was wondering how to make the camera move left or right when the player reaches the edge of the camera and stop when it reaches the edge of the game area?

View Article


basic 2D camera setup

Hey I'm new to unity and I was wondering how to make the camera move left or right when the player reaches the edge of the camera and stop when it reaches the edge of the game area?

View Article


Camera speed

here is the cs file. how to make it follow player faster? and can you convert it to java file? using UnityEngine; using System.Collections; public class CameraFollow : MonoBehaviour { public float...

View Article

How do I make my character animations work?

I need a walk sprint and idle animation script all in one when shift + uparrow is pressed he sprints and when shift is released it continues walk animation please help.

View Article

add someThing on sphere surface

I want to add a cub on the sphere surface and random the possition.Like add someThing on the planet.But I don't know how to do.thx.

View Article

Anyone Willing To Script My Model Please?

Hello,Is There Anyone Who Would Be Able To Script My Vehicle Model For Me Please.I Have Tried Over And Over Again And Just Can't Get It Right,It Would be Much Appreciated ;)

View Article


What's wrong with this code and is there an easier way to write it!?

Hi, all I want to do is instantiate a prefab I already have setup at a random spawn point. The spawn points are just Empty Game Objects and there are a few of them setup on my map. I have written this...

View Article

Raycast Shoot Automatic Fire to deal continual damage to AI

Hello everyone. Hope that I can get some help here as sifting through Unity answers I couldn't seem to find an answer. SO, basically, the below script works to damage the AI in my game, but when I hold...

View Article


How do I rotate my Camera around my sphere using the arrow keys?

My code is currently this, also it's not much however please add onto it. public GameObject playerpos; private float distancey = 3.0f; private float distancex = -4.0f; void Update() {...

View Article

How do I spawn a random prefab?

I want to spawn a random prefab from my list. The prefabs are players such as a Ninja or a Cyborg. So when the game starts, a player prefab from my list is spawn that the player can control. So every...

View Article


growing / feeding NEED HELP!!!

i have a game and i have everything set perfectly, but the most important part. I can't think of how to code it in javascript. My game is a 3rd person shooting a carrot at a rabbit. I have everything...

View Article

How can i Select a GameObject (Player) and be able to move that from point A...

View Article

I really need a script to play an audio that I have when the raycast from my...

View Article
Browsing all 92 articles
Browse latest View live




Latest Images