Child of Sphere component will not move in game?

Hi there,

I’ve derived Sphere Component into a new class with which I aim to use for checking what a character can see. For this, I want the sphere to basically float in front of the player and generate overlap events - when an actor enters, it is considered visible.

Here’s my header code (I’m assuming the C++ in this case is irrelevant!):

UCLASS(meta = (BlueprintSpawnableComponent))
class ROGUELIKE_API UCharacterVisionSphere : public USphereComponent
{
	GENERATED_UCLASS_BODY()

	//Pointers to actors that are within vision
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Character)
	TArray<AActor*> VisibleActors;

	/** called when something overlaps the predefined boundaries of the item */
	UFUNCTION()
	void OnBeginOverlap(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
	UFUNCTION()
	void OnEndOverlap(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);

	bool IsActorVisible(AActor*);
};

The problem is that, when attached to one of my characters, it always, always, stays in one place. I’ve added 4 characters around the map, each with a “vision sphere” attached, and all of the spheres seem to stack in the same spot right in the middle of the map.

This works with a normal sphere - when I attach it to the character blueprint and set it to moveable, it follows the character as shown:

The sphere in front of the character is the standard sphere. The sphere on the right, embedded in the floor, is my derived version. All of the characters in the map that have a vision sphere, the resulting sphere ends up in that location. In the picture, there are in fact roughly 5 stacked on top of each other.

Is there any good reason for this? I’ve been unable to find a good solution at all. Here’s what the blueprint editor looks like:

Any help would be extremely appreciated…

It would seem the difference between this and a regular sphere component is that this component “does not have a “Mobility” associated with it”

Does anyone know how to fix this, because clicking “moveable” does not work!

Did you make sure to add this derived version of the sphere to your root component (I’m assuming that the VisionSphere in the second screenshot is the sphere in front of your character)? I’m just asking this question, because I don’t see any other answer to your problem and this happens to me a lot. ^^

No need to feel stupid. :slight_smile:

I’m glad it helped!

Yup… that was it. Feeling a bit stupid now. Thanks for that.