Comments (4)
Which vehicle are you using - Autonomous or Biped? I expect autonomous, given your mention of _speed, but how can that value be null? It's a float, and value types cannot be null.
Please elaborate.
from unitysteer.
Sorry about the lack of precision.
Yes it's an autonomous Vehicle (it's for some kind of bugs, so I think this is the best in my case).
You are right _speed is not null, it's at NaN. I cannot explain why.
In the Velocity I put this lines :
Debug.Log("speed : " + _speed);
Debug.Log("forward : " + Transform.forward);
return Transform.forward * _speed;
And I get two kind of outputs.
One which is good :
speed : 0
forward : (0.0, 0.0, 1.0)
And one which is not :
speed : NaN
forward : (-0.2, -0.1, 1.0)
Which of course got a :
rigidbody.position assign attempt for 'walkingBug(Clone)' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.Rigidbody:MovePosition(Vector3)
TickedVehicle:ApplySteeringForce(Single) (at Assets/AlterfaceProject/scripts/UnitySteer/Behaviors/TickedVehicle.cs:268)
I'm still looking for a good explanation about this. And in particular why some times I've got a speed at 0 and some time at NaN. Unfortunatly I didn't manage to find out.
I never change the speed by myself (anyway this is an internal value).
After some others tests.
If I changed the declaration, in order to init the value like that :
float _speed = 0.0f;
I got the same problem which make sens, this is the same thing than float _speed; (http://msdn.microsoft.com/en-us/library/83fhsxwc.aspx)
But if I change the init value to :
float _speed = 0.1f;
I got no error at all.
A final test to be really sure.
I changed a little bit the CalculatePositionDelta like this :
protected override Vector3 CalculatePositionDelta(float deltaTime)
{
if(System.Single.IsNaN(_speed))
return new Vector3(0,0,0);
else
return Velocity * deltaTime;
}
Of course I get no error, wich mean the trouble is really that _speed is at NaN. But this is like killing the messenger, it was just a test to be sure.
I'm probably missing a simple thing, but I'm not able to find what.
from unitysteer.
If you look at the AutonomousVehicle code, you'll see that the only place where _speed is set is on the Speed setter, and the only thing that does is a perform a clamp of the value passed with MaxSpeed. I suggest you add some Debug.LogError in the care of either being a NaN, along with a stacktrace, right about here:
https://github.com/ricardojmendez/UnitySteer/blob/development/Behaviors/AutonomousVehicle.cs#L22
from unitysteer.
Closing until we get more details.
from unitysteer.
Related Issues (20)
- Cannot set the velocity directly on PassiveVehicle HOT 1
- Release UnitySteer 3.0f1 HOT 1
- How would you use UnitySteer for guided missiles HOT 5
- Strange behavior on Evasion when target doesn't move HOT 9
- Feature Request: Enable Ticked Length dynamic update in the Inspector
- 2D integration issues HOT 3
- UnitySteer and A* pathfinding HOT 4
- Threaded Ticked Queue HOT 1
- Using cohesion but keeping minimum distance apart HOT 3
- steer around a point HOT 1
- Code Docs with tutorial HOT 2
- Automated deployment HOT 4
- Help with SteerForPathSimplified !!! HOT 2
- Feature request: prevent SteerForPath skipping waypoints HOT 9
- I'm not clearly understand what the IsPostProcess variable means. HOT 3
- About UnitySteer and Physics HOT 5
- Follow/Align while Orbiting Another GameObject
- Basic vs Post-Processing behaviors HOT 3
- Feature request: Update instances during runtime on prefab changes
- Turning Radius
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unitysteer.