So for some reason when I used this command in one project, it returns zero, no matter what, but in another one of my projects, the same exact code works fine. What could cause this? What is the solution?
This is the code:
var anothertruth : float;
function Update(){
anothertruth=Vector3.Distance(Vector3(0, 0, 0), Vector3(0, 5, 0));
}
The only way that will ever return 0 is if the distance between the two points is in fact 0.
–Eric
Either it’s returning zero, or it’s returning nothing, because the inspector shows the value of that variable to be zero while the program is running. The distance between those points should in fact be five. However, this same code works in a different project file. I do not know why that is.
Something else is setting that variable to 0, then.
–Eric