Hi there, I’m fooling about with raycast at various gameobjects
The following gives me six rays but non of them point at the six objects, not even close. Orientation? local/world space? any ideas?
function FindPoint (tagname : String) {
// Find all game objects with tag
var gos : GameObject[];
gos = GameObject.FindGameObjectsWithTag(tagname);
var position = transform.position;
for (var go : GameObject in gos) {
// raycast, can I see it?
var raydirection = go.transform.position - position;
Debug.DrawRay(transform.position, raydirection, Color.red);
}
}
Okay, so I am including a screenshot showing the targets and rays

One thing I notice: if you shift the drawn rays left and down a bit, it looks like they roughly correspond to the visual gaps between that bottom sphere and the others. If that works out, I’d be really curious to see what’s causing such a consistent offset.
If those spheres are being drawn by gizmos, are you sure they’re being drawn in the right location?
If the spheres are an asset you imported, is the model’s origin in a smart spot, like the center of the sphere?
If the spheres are children of the objects you’re targeting, do their transforms have a local position offset?
There are other possibilities, but those are the first things that come to mind.
Solved, Duh,
Okay, so I had an empty with a sphere child and, the child wasn’t set to a local transform of 0,0,0, I should thumb myself down, what a waste of time lol, thanks Rutter, I’ll give you a thumbs up because I think that’s what you were getting at.