Ali,
Couple questions about IsNearbyMarker.
-Does it take into account the offset of actor it's attached to? (it doesn't seem to). I suppose it depends if Marker Transform coming from the select node takes offset into consideration.
-Could there be a problem with small distances not working? Edit: I think small distances are almost certainly not working.
-Can it be used with markers emitted by a custom marker emitter? I seem to be getting strange results when I use it with BPM_RoomCornerEmitter.
-For example, I'll set it to find a RoomCorner marker within 200 units of a Door marker, and it won't spawn even though it is certainly within 200 units.
bool UGridDungeonQuery::IsNearMarker(const FTransform& CurrentMarkerTransform, const FString& NearbyMarkerName, float NearbyDistance, UDungeonBuilder* Builder)
{
float QueryDistanceSq = NearbyDistance * NearbyDistance;
FVector CurrentLocation = CurrentMarkerTransform.GetLocation();
for (const FPropSocket& Socket : Builder->PropSockets) {
float DistanceSq = (Socket.Transform.GetLocation() - CurrentLocation).SizeSquared();
if (DistanceSq < QueryDistanceSq && Socket.SocketType == NearbyMarkerName) {
return true;
}
}
return false;
}
Couple questions about IsNearbyMarker.
-Does it take into account the offset of actor it's attached to? (it doesn't seem to). I suppose it depends if Marker Transform coming from the select node takes offset into consideration.
-Could there be a problem with small distances not working? Edit: I think small distances are almost certainly not working.
-Can it be used with markers emitted by a custom marker emitter? I seem to be getting strange results when I use it with BPM_RoomCornerEmitter.
-For example, I'll set it to find a RoomCorner marker within 200 units of a Door marker, and it won't spawn even though it is certainly within 200 units.
bool UGridDungeonQuery::IsNearMarker(const FTransform& CurrentMarkerTransform, const FString& NearbyMarkerName, float NearbyDistance, UDungeonBuilder* Builder)
{
float QueryDistanceSq = NearbyDistance * NearbyDistance;
FVector CurrentLocation = CurrentMarkerTransform.GetLocation();
for (const FPropSocket& Socket : Builder->PropSockets) {
float DistanceSq = (Socket.Transform.GetLocation() - CurrentLocation).SizeSquared();
if (DistanceSq < QueryDistanceSq && Socket.SocketType == NearbyMarkerName) {
return true;
}
}
return false;
}
Comment