# How to make sweep work?

**URL:** <https://forums.unrealengine.com/t/how-to-make-sweep-work/312056>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 21, 2015, 10:38pm UTC](https://forums.unrealengine.com/t/how-to-make-sweep-work/312056 "2015-03-21T22:38:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1c731aaa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1c731aaa](https://forums.unrealengine.com/u/anonymous_user_1c731aaa)\
**Post date:** [March 21, 2015, 10:38pm UTC](https://forums.unrealengine.com/t/how-to-make-sweep-work/312056/1 "2015-03-21T22:38:42Z")

</div>

Hello. I’ve faced a problem which I’m not able to solve by myself. I’ve created new class derived from APawn class, then I’ve made my custom movement component from UPawnMovementComponent. Then I set everything up like it was done in default pawn and copied some code from floating Movement Component:

```
FHitResult Hit(1.f);
	SafeMoveUpdatedComponent(Delta, Rotation, true, Hit);

	if (Hit.IsValidBlockingHit())
	{
		HandleImpact(Hit, DeltaTime, Delta);
		// Try to slide the remaining distance along the surface.
		SlideAlongSurface(Delta, 1.f - Hit.Time, Hit.Normal, Hit, true);
	}

```

This all 100% called every frame, but there is no collision presence. Further investigation led me to some strange code in USceneComponent::MoveComponent:

```
// Fill in optional output param. SceneComponent doesn't sweep, so this is just an empty result.
	if (OutHit)
	{
		*OutHit = FHitResult(1.f);
	}

```

So as I understand I need to override this function, but there is nothing like that in defaultPawn and everything works just fine. Did I miss something there?
