void ACoverActor::DetermineMovementDirection(FVector& MovementDirection, FRotator& FacingDirection) { FName NearbySocket = GetNearbySocket(); AActor* Char = UGameplayStatics::GetPlayerCharacter(GetWorld(), 0); //Determine the movement and facing direction of the player, based on the described logic //The way that we're deciding the facing direction is similar to the way we've decided //the movement direction if (NearbySocket.IsEqual("ForwardSocket")) { MovementDirection = -GetActorRightVector(); FacingDirection = GetActorRotation(); } else if (NearbySocket.IsEqual("BackwardSocket")) { MovementDirection = GetActorRightVector(); FacingDirection = GetActorRotation() + FRotator(0, 180, 0); } else if (NearbySocket.IsEqual("RightSocket")) { MovementDirection = GetActorForwardVector(); FacingDirection = GetActorRotation() + FRotator(0, 90, 0); } else { MovementDirection = -GetActorForwardVector(); FacingDirection = GetActorRotation() + FRotator(0, -90.f, 0); } }
void AMobileEnemy::BeginPlay() { Super::BeginPlay(); m_totalDistance = RightDistance + LeftDistance; m_currentDistance = LeftDistance; m_actualJumpSpeed = 0.0f; m_capsuleHeight = CapsuleComponent->GetScaledCapsuleHalfHeight(); m_capsuleRadious = CapsuleComponent->GetScaledCapsuleRadius(); m_capsuleHeightPadding = m_capsuleHeight * PADDING_ENEMY_COLLISION_PERCENT; m_capsuleRadiousPadding = m_capsuleRadious * 0.55f; m_lastPosition = GetActorLocation(); m_nextPosition = m_lastPosition; m_rightVector = GetActorRightVector(); { FVector right = GetActorRightVector(); right = right; m_rightPosition = (m_lastPosition + RightDistance * right) * right; m_leftPosition = (m_lastPosition + LeftDistance * -right) * right; } m_isMoving = !HasTrigger; m_initialMovement = m_isMoving; m_initialStatus = GetTransform(); if (Fly) m_enableGravity = false; RegisterDelegate(); }
void AUModCharacter::MoveRight(float Value) { if (Value != 0.0f) { AddMovementInput(GetActorRightVector(), Value); } }
void APawnCharacter::MoveRight(float AxisValue) { if (OurMovementComponent && (OurMovementComponent->UpdatedComponent == RootComponent)) { OurMovementComponent->AddInputVector(GetActorRightVector() * AxisValue); } }
void AShaderPluginDemoCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AGearVR_QSCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInpVR(GetActorRightVector(), Value); } }
void ASterlingResortsCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AUnreal4FPSGameCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AAvatar::MoveRight(float amount) { if(Controller && amount && !hasWon && !hasLost) { FVector fwd = GetActorRightVector(); AddMovementInput (fwd, amount); } }
void AFP_FirstPersonCharacter::MoveRight(float Value) { if (Value != 0.0f) { // Add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void ASGJAM16_SPOOPYCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
//Move right/left void APawnWithCamera::MoveRight(float AxisValue) { //Again, pass where we are moving to at the movementcomponent if (OurMovementComponent && (OurMovementComponent->UpdatedComponent == RootComponent)) { OurMovementComponent->AddInputVector(GetActorRightVector() * AxisValue); } }
void AGestureRecognizerCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AAvatar::MoveRight(float amount) { if (Controller && amount) { FVector right = GetActorRightVector(); AddMovementInput(right, amount); } }
void ASearchFinalCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void APlayerCharacter::MoveRight(float val) { if (val != 0.0f) { FVector dir = GetActorRightVector(); AddMovementInput(dir, val, false); } }
void AMobileOpenCVCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void ATotemCharacter::MoveRight(float Value) { if (Value != 0.0f && bCanMove && bAcceptMoveInput) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value * StrafeSpeedScale); } }
void AInventoryPrototypeCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AMurphysLawCharacter::MoveRight(float Value) { if (Value != 0.0f && CanPlayerMove()) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AVertexColorSpreadCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AUDKPresentationCharacter::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
void AMiniJamJuly2015Character::MoveRight(float Value) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); } }
/*Description: Moves the player sideways*/ void APoseidonCharacter::MoveSides(float value) { if (value != 0.0f && !mWasGrappleShot && !mCameraLock) { AddMovementInput(GetActorRightVector(), value); value = FMath::Abs(value); PlayerController->ClientPlayCameraShake(HeadBobClass, value); } }
void AAvatar::MoveRight( float amount ) { //if( inventoryShowing ) return; if( Controller && amount ) { FVector right = GetActorRightVector(); AddMovementInput(right, amount); } }
// Called every frame void APawnWithCamera::Tick(float DeltaTime) { Super::Tick(DeltaTime); //Rotate our actor's yaw, which will turn our camera because we're attached to it { FRotator NewRotation = OurCameraBase->GetComponentRotation(); NewRotation.Yaw += -CameraInput.X; OurCameraBase->SetWorldRotation(NewRotation); } //Rotate our camera's pitch, but limit it so we're always looking downward { FRotator NewRotation = OurCameraBase->GetComponentRotation(); NewRotation.Pitch = FMath::Clamp(NewRotation.Pitch - CameraInput.Y, -80.0f, 80.0f); OurCameraBase->SetWorldRotation(NewRotation); } //Handle movement based on our "MoveX" and "MoveY" axes { if (!MovementInput.IsZero()) { //Scale our movement input axis values by 100 units per second MovementInput = MovementInput.SafeNormal() * 100.0f; FVector NewLocation = GetActorLocation(); NewLocation += GetActorForwardVector() * MovementInput.X * DeltaTime; NewLocation += GetActorRightVector() * MovementInput.Y * DeltaTime; SetActorLocation(NewLocation); } } FVector LeftEyePosition = LeftEyePos->GetComponentLocation() - OurCamera->GetComponentLocation(); LeftEyePosition.Normalize(); FVector RightEyePosition = RightEyePos->GetComponentLocation() - OurCamera->GetComponentLocation(); RightEyePosition.Normalize(); FVector4 LeftEyeWeight; FVector4 RightEyeWeight; for (int i = 0; i < 4; i++) { LeftEyeWeight[i] = FVector::DotProduct((LeftEyePosition - FishEyePos[i]), dir[i]) / length[i]; RightEyeWeight[i] = FVector::DotProduct((RightEyePosition - FishEyePos[i]), dir[i]) / length[i]; } RV_MatInst->SetVectorParameterValue(FName("LeftEyePos"), LeftEyePosition); RV_MatInst->SetVectorParameterValue(FName("RightEyePos"), RightEyePosition); RV_MatInst->SetVectorParameterValue(FName("RightWeight"), LeftEyePosition); RV_MatInst->SetVectorParameterValue(FName("LeftWeight"), RightEyePosition); }
void AMyCharacter::Strafe(float Scale) { FString Message = FString::Printf(TEXT("Scale = %f"), Scale); GEngine->AddOnScreenDebugMessage( 1, 5.f, FColor::Red, Message); CharacterMovement->AddInputVector(GetActorRightVector() * Scale * 10); }
void ASECharacter::MoveRight(float Value) { if (State != ECharacterState::Idle || ZoomState != ECharacterZoomState::None) return; auto PS = CastChecked<ASECharacterState>(PlayerState); if (!PS) return; if (PS->CursorState == ECharacterCursorState::Locked && Value != 0.0f) AddMovementInput(GetActorRightVector(), Value); }
// Called when the game starts or when spawned void ABouncerPlayer::BeginPlay() { Super::BeginPlay(); //Set the bounds based on where the player starts rightVector = GetActorRightVector(); rightBounds = GetActorLocation() + GetActorRightVector() * 250; leftBounds = GetActorLocation() + GetActorRightVector() *-250; startRotation = Mesh->GetComponentRotation(); StunnedMeshTwo->SetVisibility(false); StunnedMesh->SetVisibility(false); //set overhead camera position //Camera->SetWorldLocation(FVector(-1300, 0, 1500)); //Camera->SetWorldRotation(FRotator(-55, 0, 0)); APlayerController* PlayerController = Cast<APlayerController>(Controller); if (PlayerController) PlayerController->bForceFeedbackEnabled = true; }
void ACharacterKim::MoveRight(float Value) { // if (Stunned->isActive == false) { if (Value != 0.0f) { // add movement in that direction AddMovementInput(GetActorRightVector(), Value); if (ActiveAbility->bIsActive == true) { ActiveAbility->DeactivateAbility(); } } // } }