private void OnFirePressed() { var character = GetCharacter(); var result = new FHitResult(); GetWorld().DebugDrawTraceTag = "drag&drop"; GetWorld().LineTraceSingleByChannel( result, character.GetCapsuleComponent().GetWorldLocation(), character.GetCapsuleComponent().GetWorldLocation() + GetControlRotation().Vector() * DragDropDistance, ECollisionChannel.ECC_Visibility, new FCollisionQueryParams(GetWorld().DebugDrawTraceTag, true, null), new FCollisionResponseParams(ECollisionResponse.ECR_Block) ); _pickUpObject = result.GetActor(); _dragDistance = result.Distance; if (_pickUpObject?.IsRootComponentMovable() == false) { _pickUpObject = null; } Ue.ScreenDebugMessage(result.GetActor()?.GetName()); }
protected override void BeginPlay() { try { PrimaryActorTick.bCanEverTick = 1; _box = new UBoxComponent(this, "Simple Child"); _box.RegisterComponent(); var root = GetRootComponent(); var rootSm = root as UStaticMeshComponent; Ue.ScreenDebugMessage(rootSm?.GetFullName() ?? "null"); _box.AttachToComponent(root, FAttachmentTransformRules.SnapToTargetIncludingScale, ""); _box.SetCollisionProfileName("OverlapAll"); _box.SetBoxExtent(new FVector(100, 100, 100), false); _box.OnComponentEndOverlap += Box_OnComponentEndOverlap; } catch (Exception e) { Ue.LogError(e.ToString()); } }
public static string MyTestMethod(string arguments) { try { Ue.ScreenDebugMessage($"epepeep"); return($"The string have {arguments.Length} symbols!"); } catch (Exception e) { return(e.ToString()); } }
private void OnFire() { var character = GetCharacter(); var result = new FHitResult(); GetWorld().DebugDrawTraceTag = "test"; GetWorld().LineTraceSingleByChannel( result, character.GetCapsuleComponent().GetWorldLocation(), character.GetCapsuleComponent().GetWorldLocation() + GetControlRotation().Vector() * 800, ECollisionChannel.ECC_Visibility, new FCollisionQueryParams("test", true, null), new FCollisionResponseParams(ECollisionResponse.ECR_Block) ); Ue.ScreenDebugMessage(result.GetActor()?.GetName(), 20); Ue.ScreenDebugMessage(character.GetCapsuleComponent().GetWorldLocation().ToString(), 5, System.Drawing.Color.Red); }
public override void Tick(float deltaSeconds) { Ue.ScreenDebugMessage(_bodyCount.ToString(), 0, Color.DodgerBlue); Ue.ScreenDebugMessage(_time.ToString(), 0, Color.Green); if (_isMove) { AddActorLocalOffset(new FVector(0, 0, deltaSeconds * 100), true, new FHitResult(), ETeleportType.None); } else { if (_bodyCount != 0) { _time += deltaSeconds; if (_time >= ActivateTime) { _isMove = true; } } } }
private void Box_OnComponentEndOverlap(UPrimitiveComponent overComp, AActor otherActor, UPrimitiveComponent otherComp, int otherBodyIndex) { Ue.ScreenDebugMessage($"{otherActor} don't overlap {overComp} now"); }
private void BoxOnOnComponentBeginOverlap(UPrimitiveComponent overComp, AActor otherActor, UPrimitiveComponent otherComp, int otherbodyindex, bool bfromsweep, FHitResult sweepresult) { Ue.ScreenDebugMessage($"BeginOverlap {otherActor} don't overlap {overComp} now"); }
public override void Tick(float deltaSeconds) { Ue.ScreenDebugMessage(GetCharacter().GetActorLocation().ToString(), 0); }