Quantcast
Channel: Questions in topic: "round"
Browsing latest articles
Browse All 87 View Live

Round Timer: Time.smoothDeltaTime stops the clock...

using UnityEngine; using System.Collections; public class EnemySpawn : MonoBehaviour { public float timeLeft = 300f; public float roundPause = 60f; int numEnemies = 100; public GameObject enemies;...

View Article


Round to 0.5, 1.5, 2.5 ...

Is there a way to round a number in increments of one but to be offset by one? So for example if a number is 0.7 it would round down to 0.5 and if a number is 1.2 it will round up 1.5. Would it use...

View Article


Warp Shader?

How can I make a flat plane with boxes sticking out look round like [this]?[1] [1]: http://24.media.tumblr.com/cc49cdf98ae63b622b931568d8d31c99/tumblr_n62hrh2H1P1r4mh0bo1_500.gif

View Article

Round x, y and z values of object?

Hey, I'm wanting to have the objects in my scene snap to a grid and so Ive been trying to round the x, y and z values of these objects to the nearest full numbers hoping it would give this effect. My...

View Article

How can I detect when a float value crosses an integer threshold?

I have a float value that I'm trying to have trigger a sound event whenever it crosses past an integer threshold. The user is able to increment the value in 0.1 increments. In other words, whenever the...

View Article


9 sliced Sprites

Which is the best way to create resizable sprite? I have a png ![alt text][1] [1]: /storage/temp/40930-pengesa-u.png and I need it in different sizes also I need to keep the corners. Can I create...

View Article

MoveTowards produces decimal fractions in x and z axis

I'm using MoveTowards to move smoothly a ball in a grid type field, but I've noticed little errors in the target position, here is my code: public static bool isMoving = false; public Vector3...

View Article

Double Rounding Problem

I want to round a number to 2 decimails. Using Math.Round it works fine until the number is 1e15 or greater where unity shifts from showing the whole number to showing it using e and I can have up to...

View Article


C# round transform.position floats to .5

I would like to round my gameobjects transform.position floats to .5 when I move. I was able to get it to work with Mathf.RoundToInt but with Mathf.Round/2 the gameobject never makes it to 0.5 resets...

View Article


Draw a Sprite Round

Hi all, How can I draw(or show) my sprite as rounded sprite? I wanted to have it like this: ![alt text][1] This panel will download image from facebook and change its sprite to the downloaded fb image....

View Article

Can I get GUI to appear slightly curved or rounded?

I want to experiment with a little, futuristic, space-oriented, first-person game where the player will wear a helmet that displays information to them, like the condition of their limbs or something....

View Article

Sprite Snap and Follow Mouse

Been having problems getting this short script to have an object snap to round number (int). The object I attached it to continues to have a trailing decimal(float). I have a feeling it's because of...

View Article

round meshes makes the game glitch

You'll see, i recently updated unity to 5.2.1f1, & everything was fine (that was like 5 days ago). Today i opened my session again & i noticed this weird looking glitch on the textures. I don't...

View Article


How Would I Make A Round Based System Like Csgo

I Am Making A unity Game Game And Would Like To Know How To Make A round Based System Like The Round Based System In Csgo? Eg. If All the team terrorists get killed Everyone That Died That Round Will...

View Article

C# Mathf.Round Not Rounding Input.mouseposition

I'm trying to create a script that makes the scripted gameobject follow the mouse and round it's position. However when I played the scene the Input.mouseposition.x and Input.mouseposition.y weren't...

View Article


Can't seem to round to 2 DP

I am making a slot machine game and the winning point should be in 2 decimal places to symbolize money, i tried both System.Math and Mathf.Round but none of them seems to work. Are there any other ways...

View Article

Transform values not exact

hello, sometimes the transform values on a gameobject suddenly change like this: http://prntscr.com/bmz9is it's not a big issue, but is there any reason why this is the case? and a possible fix? thank you

View Article


Time.timescale=0 not working when the timeleft "countdown" reduce to 0

the game should stop if the timeleft=0 on update. Can someone tell me why and fix the scripts ThankYOu using UnityEngine; using System.Collections; using UnityEngine.UI; using...

View Article

How to calculate/find/get a normal vector from an object to a round planet to...

I am just starting to build a game where the player controls a tank on a round world/planet. I have implemented a gravity script that pulls objects to the planet. the tank falls and drives around and I...

View Article

NES Battle city like movement when turning (teleporting to fit through the...

This is what I'm talking about [https://gyazo.com/20bd71273164bd1cfe0f276ecf83e690][1] As the title say i'd like to make my tank move through the gap smoothly without making the tank collider smaller....

View Article

Make texture / spear full rounded

I´m working on my 2D Android Game and I am bothered by one thing. The edges are not completely rounded and it really bothers me.![alt text][1] ![alt text][2] [1]: /storage/temp/81253-roundsphere.png...

View Article


How round off a vector2?

Hello. How i can round coordinates of vector without leave direction (make all vectors with same length)?![alt text][1] I want to make a vectors of the same length. Thank you. [1]:...

View Article


3 by 1 grid with mathf.round and ScreenToWorldPoint

Hello! I want to make a game where I place platforms, and then the automatic runner jumps onto it, but my problem is that my platforms are 3 by 1 and not 1 by 1. Then the Mathf.round won't work because...

View Article

Appear, Disappear problem in VR camera

![alt text][1] This is Camera Component under CameraRig in SteamVR asset. And I'm having problem with sight problem. When looking objects(especially Terrain) near Clipping Planes appear and disappear....

View Article

Smoothly resize sprite with rounded corners?

I have a rounded rectangle sprite that I need to be resized across a single axis. Right now it's a square, but I will need it to be resizeable on the Y axis without stretching the borders or warping...

View Article


Move 8 cubes depening on what round

Hi everyone ! i have 8 cubes thats around a smaller cube in the center. What im trying to do is to make a cube mov towards the center so that the smaller cube can dodge it and i want to send more cubes...

View Article

Problem with textures on round surfaces

I want to design barrel for the game, and problem with materials occurs when adding specular map to make scratches on the barrel. Material in preview looks perfect but added on 3D barrel object it...

View Article

Terrain tool not ROUNDY

This started happening a couple of days back and I don't know why. The terrain tool it's simply not "roundy". When I press to sculpt it's different. I don't know if it's something I clicked on,...

View Article

How to serialize/save a vector3 without all decimals?

First of all I alredy preroundet the decimals to 3 decimals but here is the problem when I serialize the preroundet floats as Vector3:...

View Article



Weird behavior with % operator

So i'm calculating some positions and my problem is that this line: Mathf.Abs(Mathf.Round(pos.x * 100) / 100) % (4 * scale) returns 115,6 where it should return 0 (115,6/115,6 should give 1). I thought...

View Article
Browsing latest articles
Browse All 87 View Live


Latest Images