Quantcast
Channel: Latest Questions by betaFlux
Browsing all 30 articles
Browse latest View live
↧

Legacy Animation Walk Speed relative to Movement Speed

Hello, I am calculating the movement speed of a navmesh agent like this: float currentSpeed = 0; Vector3 currentPosition = Vector.zero; Vector3 lastFramePosition = Vector3.zero; void Awake() {...

View Article


How to store Gizmo (grid) Cube positions in Vector3 list at game start?

I have written this script to create a grid of gizmo cubes: using UnityEngine; using System.Collections.Generic; public class Grid : MonoBehaviour { public int[] rows; //public int[] columns; //not...

View Article


Need Help adding Main Color Property to a complicated Shader

Good day! I have gotten my hands on a great hair shader, the best i've ever seen so far. Now **I need to change the main color**, but I don't have a clue how this can be done. I googled a lot and tried...

View Article

Random.insideUnitSphere doesn't work as expected

Does anyone know why this snippet returns a position around world space zero? (the transform is a child) float radius = 5; float zDistance = 5; targetPosition = new Vector3(Random.insideUnitSphere.x *...

View Article

Constant Transform Lerp

Is it bad practice to let a transform constantly re-position and rotate itself to a target with Vector3.Lerp and Quaternion.Lerp? For example: Camera.main.transform.position =...

View Article


Incorrect usage of Vector3.Dot?

Hello, I am trying to make a game similar to Rimworld or Prison Architect, so I have a AI controlled sprite character with 4 different sprites for each main direction and I'm currently trying to...

View Article

zoom problem with GUI Box that follows a character

I have a GUI box following a sprite character in a 2d Top Down Game. If I zoom in, the GUI box goes up, if I zoom out, the GUI box moves down, instead of staying at the point it was drawn at game...

View Article

Array = null when passing as parameter

Straight to the point. The following code is in a script that executes before all other scripts: public static AudioClip[] FootstepSounds; void Start() { FootstepSounds = Resources.LoadAll("Sound...

View Article


How to add one onClick Event to multiple UI buttons

Hello, I must be missing something essential here. This is what I've tried: void Start() { // Assign the callback to all buttons foreach(Button subbutton in canvas.transform.GetComponentsInChildren())...

View Article


UnityEditor GenericMenu - Problem with 'AddItem' in Foreach Loop

I'm working on a custom inspector and I'm trying to populate a GenericMenu with the content of a string array like this: public override void OnInspectorGUI() { if(GUILayout.Button("Add Type")) { var...

View Article
Browsing all 30 articles
Browse latest View live


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