[Mono-ue] How do you use GetOverlappingActors?
Ryan Burnham
nitro52 at iinet.net.au
Sat Jan 10 08:05:12 UTC 2015
Is anyone able to get this to work? It just returns an empty collection for me.
-----Original Message-----
From: Michael Hutchinson [mailto:m.j.hutchinson at gmail.com]
Sent: Friday, 9 January 2015 6:19 AM
To: Ryan Burnham
Cc: mono-ue
Subject: Re: [Mono-ue] How do you use GetOverlappingActors?
SubclassOf<T> is analogous to the Unreal TSubclassOf<T> template:
https://docs.unrealengine.com/latest/INT/API/Runtime/CoreUObject/UObject/TSubclassOf/index.html
That said, the "subclass" terminology is confusing and it would probably make sense for us to rename it to UClass. I've added this to our task tracker.
This particular method is autogenerated and it looks like the generator doesn't handle the fact that the classFilter parameter is optional. I've added this to the tracker too but you should be able to work around it by using default(SubclassOf<Object>) which would have a null UClass pointer.
- m
On 5 January 2015 at 06:50, Ryan Burnham <nitro52 at iinet.net.au> wrote:
> Hi All,
>
>
>
> So I’m trying to convert the following C++ code
>
>
>
> TArray<AActor*> CollectedActors;
>
> CollectionSphere->GetOverlappingActors(CollectedActors);
>
>
>
>
>
> Where CollectionShpere is defined as
>
>
>
> UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Power)
>
> TSubobjectPtr<class USphereComponent> CollectionSphere;
>
>
>
>
>
>
>
>
>
> So I was thinking it would be something like this
>
> IList<Actor> collectedActors;
> CollectionSphere.GetOverlappingActors(out
> collectedActors);
>
>
>
> But GetOverlappingActors only has an overload with 2 parameters.
>
>
>
> public unsafe void GetOverlappingActors(out IList<Actor>
> overlappingActors, SubclassOf<Object> classFilter)
>
>
>
> How do you get the class filter. These SubclassOf and Subobject
> wrappers seem a bit odd to me.
>
>
>
> Regards
>
> Ryan
>
>
> _______________________________________________
> Mono-ue mailing list
> Mono-ue at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-ue
>
--
Michael Hutchinson ~ https://mhut.ch
More information about the Mono-ue
mailing list