What does this mean?
4 posts • Page 1 of 1
What does this mean?
I tried to create a script that one object will disappear when another object hit on the specific object.
The code was:
The specific object:
The disappearable object:
The object disappeared without any problems, and the console said:
So how should I fix this problem?
The code was:
The specific object:
- Code: Select all
onCollide = (e) = > {
scene.my.Leg14E = true
}
The disappearable object:
- Code: Select all
poststep = (e) = > {
timeToLive = (scene.my.Leg14E) ? 0.0001 : inf
}
The object disappeared without any problems, and the console said:
WARNING - timeToLive was bound to bad type. Restoring to last known value.
So how should I fix this problem?
- AN9K
- Posts: 5
- Joined: Tue Jun 30, 2015 12:14 am
Re: What does this mean?
I think the warning is just to say the object is bad so it was removed, which is what you were trying to do.
.
-
icrls984 - Posts: 80
- Joined: Thu Jun 13, 2013 6:33 am
Re: What does this mean?
there is no "inf" value. It should be +inf (or -inf).
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: What does this mean?
@AN9K - You got the warning because your code is trying to store a Boolean operator (true or false) in TimeToLive which can only have a positive real number between zero and infinity.
Also, do you know the difference between "=" and "==" ?
"=" means copy the value from right side of equal sign to variable on left side of equal sign.
"==" asks the question: Does the value on the left side of the double equal sign equal the value on the right side of the double equal sign?
One is an action, and the other is a comparison.
BTW - A better script in the disappearing object is this:
postStep = (e) = > {
scene.my.Leg14E ? {TimeToLive = 0} : {}
}
Also, do you know the difference between "=" and "==" ?
"=" means copy the value from right side of equal sign to variable on left side of equal sign.
"==" asks the question: Does the value on the left side of the double equal sign equal the value on the right side of the double equal sign?
One is an action, and the other is a comparison.
BTW - A better script in the disappearing object is this:
postStep = (e) = > {
scene.my.Leg14E ? {TimeToLive = 0} : {}
}
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests