Quantcast
Channel: Questions in topic: "invokerepeating"
Browsing all 220 articles
Browse latest View live

store positional data into a csv file

I am currently working on a school project where I'll be using motion capture and unity. It's made for the elderly to improve their cognitive and motoric functions. I want unity to be able to record...

View Article


Why aren't Coroutines working for me?

Hi, I was originally using InvokeRepeating for my enemies to spawn and it is fine if they spawn at a continuous rate but I want them to spawn faster and faster as the game goes on but since...

View Article


How to Spawn multiple game object one by one in random order

i am creating a game where 3 random game objects ( green cube, red cube and blue cube) spawn one by one in random order. my approach to this is creating a RNG value for each game object ("if RNG <=...

View Article

I want to generate gun fire whenever i press Space button

I want to generate gun fire , not continuous bust of fire images I want some delay Because gun will take time to load,and when I release that button firing should stop. For this I have used...

View Article

InvokeRepeating firing too often

I'm trying to make a defend-the-castle style game where enemies spawn on a line. The enemies spawn fine, but the InvokeRepeating in my script fires way too often. Not sure if this is user error, but I...

View Article


InvokeRepeating doesn't react

https://youtu.be/3FPO72a9N3A --- So, I wanted to Implement so-called ,,Coyote Time". --- I planned the Script to go something like this: 1. The Time, how long the Player was in the Air, should be...

View Article

Using InvokeRepeating () causes objects to move up

public GameObject previousObject; Renderer rend; Renderer prevRend; void Start() { rend = GetComponent(); prevRend = previousObject.GetComponent(); InvokeRepeating("Position", 0, 0.000015f); } void...

View Article

,Enemy AI rapidfires and invokerepeating doesn't do anything. c#

So I have been designing an fps game and scripted this shooting enemy that is supposed to shoot at the player if he is in the trigger zone once every second, but it just rapidfires and invokerepeating...

View Article


How bad for performance is using InvokeRepeating several times per frame?

Say I have 30 or 40 objects updating their positions like this: InvokeRepeating ("Position", 0, 0.000015f); Update doesn´t work fast enough and parenting doesn´t work either, but for different reasons....

View Article


InvokeRepeating time doesn't sync within the same update function

As the title suggests, I basically have two identical InvokeRepeating loops in my script, and one works as it should while the other doesn't. void Update () { if (Input.GetKeyDown(KeyCode.Z) &...

View Article

,Can i use InvokeRepeating to spawn just 1 GameObject at a time?

I'm trying to spawn collectible coins randomly within my game, and i have managed to get this working by doing the following: public GameObject coin; // prefab to be spawned public Transform[]...

View Article

why won't an invokerepeating cancel?

I've been looking into this and just can't seem to figure out what I'm doing wrong. I want an invokerepeating to cancel when the gameObject is inactive. Here's what I've got: void Start() { if...

View Article

Variable bug???

// my variable named NumberOfButtons print 1 + 1 + 1 every 2 seconds due to my invokerepeating but when I clic on one of my circles it does not do a - 1 on the variable it keeps going + 1 + 1 + 1 + 1...

View Article


How to avoid accelerometer drift ?

Hi ! I am working with the myo armband sensor, and I try to integrate the accelerometer data from the myo in order to move a cube : public GameObject myo = null; private Vector3 _initialposition;...

View Article

IndexOutOfRangeException: Array index is out of range

IndexOutOfRangeException: Array index is out of range, it's my problem with this script at 37th line (GameObject Newaster = Instantiate (aster[spawnObject], spawnPoints [spawnIndex].position,...

View Article


How to subtract live when a game object destroy itself?

Hello, I'm making a simply whac-a-mole game and i have trouble about life system. I have basicly 12 spawn points and the program spawns randomly gameObjects on spawn points. When we click on those...

View Article

Uneven object Instantiation

I want to instantiate one cylinder in continuity with another cylinder at the end. In this manner, it follows a rate of continuous instantiation that will create a tunnel eventually (On the basis of...

View Article


What is the most accurate way to call a function based on time?

I'm making a sort of music game where you need to spin a crank with the BPM. I was originally using a simple Time.deltaTime timer on every update, but after trying to sync it with some music I noticed...

View Article

how to run two different function every x seconds based on bool value?

I know I can use invokeRepeating to run function every x seconds. And invokeRepeating should not be in Update or FixedUpdate. It should be in Start or Awake. But in my code it doesn't work. Please look...

View Article

How to make repeateRate random in "InvokeRepeating"

public class SpawnToken : MonoBehaviour { public GameObject tokenPrefab; private Vector3 spawnPosition; private float startDelay = 1.0f; private float repeatRate = 2.0f; private float spawnRangeX =...

View Article
Browsing all 220 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>