how to generate random number 1 to 10 without repeated any number if all...
ArrayList numbers = new ArrayList(); for (int i = 0; i < 10; i++) { numbers.Add(i); } int[] randomNumbers = new int[numbers.Count]; for (int i = 0; i < randomNumbers.Length; i++) { int thisNumber...
View ArticleTexture repeat not working!
Hi, I want to tile a texture over a large object and it just stretches. My texture settings are: Texture type: **Texture** Alpha from grayscale: **false** Wrap Mode: **Repeat** Filter Mode:...
View ArticleSpace Shooter Tutorial - Game View Ship Afterimages
Just started my attempt at the Space Shooter Tutorial. When I run the game within Unity it leaves an afterimage of where my ship was (as seen on the picture). This problem does not occur in the actual...
View ArticleInstantiate an object on the end of another object continuously (C#)
Hi, I'm trying to get a road to instantiate in blocks on a button click. The road blocks are 1000 units long. public class StraightRoadSpawn : MonoBehaviour { public GameObject StraightRoad; public...
View ArticleTrying to solve an issue with a while loop to search to see if numbers are...
I'm going to try to explain this the least confusing way possible. In previous methods I created the array - pieces[]. I added gameObjects according to their tag to the array. Below I have the script...
View ArticleGUI button play animation
Hello, I got a problem on using Button play animation. I can press the button and animation can be played. But It seems the animation cannot be repeated or play inverse if i click in the button again....
View ArticleTextureWrapMode repeats despite UV being 1
I create a mesh with 4 x 4 vertices and create a Texture2D with 5 x 5 pixels (set the TextureWrapMode to Repeat). Then in vertex shader I simply read the pixel values from the texture, based on each...
View ArticleMaking Coroutine Repeat?
I'm currently trying to code a charge shot for a weapon, just like you'd see in a Mega Man game. However, while everything else seems to work just fine for the first shot, the next ones do not. It's...
View ArticleRepeat notification android
Hi, I'm creating an App for Android. I created a reservated area and inside it I added two drop-down, one for the frequency (weekly or monthly) and the other for the timing of the day. The app must...
View ArticleHow can I use a tile set to texture a large mesh?
I am new to Unity and game design (however I'm very experienced with programming). I am creating a large 3D mesh in Blender for my terrain, as I am trying to make a very low-poly terrain and I don't...
View ArticleMathf.Repeat in ShaderLab?
Hello, i looked around but couldn't find a shader intrinsic function that does what mathf.repeat does. Do you know if there is one?
View ArticleRepeating actions with frequency and shape (LFOs)
Hi everyone - I'd like to add another feature to a project I'm working on and still learning the ropes. This time I'd like to take the HeightMap texture value from a plane and "oscillate" it, from one...
View ArticleHow to loop IEnumerator
I'm fairly new to coding so forgive me for being dumb. I need thing code to restart itself when it reaches this --> //Keep restarting IEnumerator forever.) using System.Collections; using...
View ArticleHaving problem with Destroying GameObject
ERROR - the object of type gameobject has been destroyed but you are still trying to access it So I'm creating Doodle Jump for learning and I want as soon as my camera and player goes up The...
View ArticleSetting texture wrap mode from script
I want to set Texture2D wrap mode to Repeat from script. Unfortunately this does not seem to work. fillTexture.wrapMode = TextureWrapMode.Repeat; fillTexture.Apply();...
View ArticleHow Repeatedly Game Object store in array??How Identify??
i take a one prefab(paint) and store in array but problem is there repeatedly prefab store?? when my player(cube) move forward then store the gameobject in array when my player(cube) move backward then...
View ArticleGetKey problem on client
Hello, I have package looting system. (I'm using photon for multiplayer) It's working like this: OnTriggerStay > GetKey > Send RPC to master to delete package and spawn item. But there is one...
View ArticleMathf repeat at the end? help!
Hello! I need to make it when the Mathf.lerp function reaches the set value, that is, at the end, it repeats How could I do this? Thank you! ClutchTorque = Mathf.lerp (MaxClutchTorque2,...
View ArticleTrying to avoid repeating elements on list (random.range)
This is a bit of a followup to this post: https://answers.unity.com/questions/1709250/transformrotate-on-z-axis-moves-the-entire-object.html?childToView=1709334#comment-1709334 I have a circle of 4...
View ArticleHow to setup an Android notification at fixed time?
Hello everybody, I'd like to be able to send a daily notification for an Android app I'm developing. The goal is to send a notification, each day of the week, at 20:00 (regardless whether the...
View Article,Parallax background not loading fast enough
I am trying to implement a parallax background in my game and the background repeats the children after my camera has passed the position. Like in a working parallax background, the children always...
View ArticleNew Scene Or Same Scene
HI, I would like to ask. If i want to redo the scene, so from the start scene > playing scene > result > playing scene. What should i do to redo playing scenes with differences(Level...
View ArticleMaking a repeating event that detects if you are in the rain?
I want to write a script (or multiple scripts) that randomly selects a time for an event called “rain”. When the event starts, a message will display on the corner of your screen warning you that the...
View ArticleHow do I clamp a texture only on the y axis, but repeat on the x axis?
I have a texture which I want to repeat horizontally (x axis) only, but the y axis should be clamped so it does not repeat. Is this possible in Unity? If so how would I do this?
View ArticleWeird Input System situation
public void OnShootX(CallbackContext ctx) { if (ctx.performed) IsShooting = true; if (ctx.canceled) IsShooting = false; } private void Update() { if(IsShooting) { Shoot(); } else {...
View ArticleHow do i make trail material separated?
I wanted to make a block trail for my Player but the blocks are stuck together and are making one long trail instead of multiple blocks. For the normal ball trail i got a sprite from a tutorial and the...
View ArticleOnUnityAdsDidFinish() repeats when I restart the game
When OnUnityAdsDidFinish () starts, it works, but when I restart the game (load the same scene again), **I don't know why, but (when the ad ends) OnUnityAdsDidFinish (), it starts twice.** If I restart...
View Articlei wrote this code to rotate a cube wait for seconds and Return it to its...
void Update() { if (rotation1 == true) { rotatehead(); } if (rotation2 == true) { Quaternion target2 = Quaternion.Euler(0, 0, 0); transform.rotation = Quaternion.RotateTowards(transform.rotation,...
View ArticleCannot repeat image sprite on unity 2d.
I can't make a ground sprite repeat, I had an old project that I had no problems with that but now on a new project I made I can't to that. My sprite is a png of grass. I have set wrap mode to repeat...
View ArticleMathf.Repeat Never Returns 0
I am having issues implementing a score counter that increments up by 1 every defined "day" within the TimeManagement script. dayDuration is a public float that means "how many real world seconds is...
View Article