Quantcast
Browsing all 51 articles
Browse latest View live

Why does my Physics.gravity revert value change when accessed by one script,...

Wow, that's a verbose title. Physics.gravity = -other.transform.up * GRAVITYCONSTANT; This is the line I'm using in one script, which simply doesn't work. looking at the data of the debug log, it tells...

View Article


Is there a way to have rigid bodies collide, but not transfer any force?

At least that's in essence what I need. I have a rigidbody platform that I need to move another rigidbody across, but as I try to move one across the other, the rigidbody platform starts moving due to...

View Article


Is there a way to stop a rigidbody from moving in a specific direction?

The way I would usually do it is by setting rigid.velocity = new vector3 and then zeroing out one of the directions I don't want the object to be able to continue in, but since the direction can be...

View Article

Is there a way of seeing which script accessing each other?

I've got a feeling that one of my scripts is modifying variables or using functions in another script; I now want to stop that but I'm afraid I might have lost track and am trying to figure out if...

View Article

Why would a boolean change when checked by another script?

Using debug.log to check the boolean every update, in the script holding the boolean it finds it as false - in another script checking the same boolean, it finds it as true. This is thoroughly...

View Article


What does rigidbodies sleeping have to do with collision detection?

I have a script that fails to interact with rigidbodies inside its trigger collider once those rigidbodies have stopped moving and fallen asleep. public class ForceBack : MonoBehaviour { public float...

View Article

Does an asleep rigidbody mess with the OnTriggerEnter function?

void OnTriggerEnter(Collider col){ Debug.Log (col.name + " is in the volume"); } The code is extremely unexciting, but the collider name isn't even displayed. I noticed that this happens shortly after...

View Article

Is there an element similar to timescale that can be manipulated for...

It's essentially all in the title. I'd like time to slow an object for a brief time when an enemy is struck - not just affect animations, but the code (countdowns) for the object to be affected, too,...

View Article


What's stopping 'WaitForSeconds' from working?

I have the script with the coroutine: float maxDuration = 0.5f; public IEnumerator slowDown = null; float countdown = 0; public IEnumerator SlowTime(float scale, float dur){ if(dur > maxDuration){...

View Article


What is the best method for setting up a variable wait time in a coroutine?

There's a point in a coroutine where I have the typical yield return new WaitForSeconds(variableTime); but if something happens in the meantime, I would like to force the coroutine to stop waiting and...

View Article

What's the best compromise for inspector-using event system?

I'm trying to have a large scale, adaptive, as generic as possible, inspector friendly event system. The issue that I have is using the unityevents for the class that wants to pass on subscriber data,...

View Article
Browsing all 51 articles
Browse latest View live