Mathf.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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Article