- Home /
Unitysteer Spherical Obstacle Repulsion problems
Anyone knows how SteerForSphericalObstacleRepulsion works? I'm trying to implement this steer behavior but the char ignores the obstacles and keeps hitting them. I've added a Radar to the char, a steer for point and a SteerForSphericalObstacleRepulsion behavior, I have added the obstacles script to the obstacle but the char still hits the obstacle. . .any guess?
P.s. I'm using Unitysteer 2.5b3
Answer by Abomb · Oct 23, 2012 at 01:12 PM
You also have to assign the obstacles to a layer and add that layer to the radar "obstacle layers" and "layers checked".
Done Sir, no luck
here you can see the screen https://dl.dropbox.com/u/25470280/Screen.zip
Answer by Uncasid · Feb 06, 2013 at 03:53 PM
After looking through the code, if you are setting the station as a vehicle, you need to remove it:
(From Radar):
for (int i = 0; i < _detectedObjects.Count; i++) {
var d = _detectedObjects[i];
var v = d as Vehicle;
if (v != null && (v.enabled || _detectDisabledVehicles)) {
_vehicles.Add(v);
}
else {
_obstacles.Add(d);
}
}
(And now from repulsion) if (Vehicle.Radar.Obstacles == null || !Vehicle.Radar.Obstacles.Any()) { return avoidance; }
As you can see, it will only detect non-vehicle objects
Answer by guildwriter · Feb 19, 2013 at 03:42 PM
Ensure that the detection radius variable in the Radar script has been set to a value that can encompass the max speed of your vehicle multiplied by the estimation time of SteerForSphericalObstacleRepulsion.
In other words if max speed is 10, and the estimation time is 1, make sure your detection radius is at least greater than 10.
Your answer
![](https://koobas.hobune.stream/wayback/20220613082755im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Integrating UnitySteer with my wheeled collider based Rigidbody vehicles 0 Answers
Gradual Acceleration? 1 Answer
Help needed in UnitySteer 0 Answers
UnitySteer, obstacle avoidance, and wide vehicles 0 Answers
Does UnitySteer work well for 3D spaces? 2 Answers