diff --git a/SeagullGame/Content/John/BP_John.uasset b/SeagullGame/Content/John/BP_John.uasset index f2e4b4d..c1832a7 100644 --- a/SeagullGame/Content/John/BP_John.uasset +++ b/SeagullGame/Content/John/BP_John.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0499a4d6399028ae61780a83380aff1b8c62fa50f09d0e15d4e32cc0fbff3e8f -size 162871 +oid sha256:d43815224a149eb4619558a6457868854fa82630ef6773486efc2bbc56deadbb +size 163277 diff --git a/SeagullGame/Content/John/John_standing_geared_uo.uasset b/SeagullGame/Content/John/John_standing_geared_uo.uasset new file mode 100644 index 0000000..601d085 --- /dev/null +++ b/SeagullGame/Content/John/John_standing_geared_uo.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7eda2341f95a94e075e67abd4439744c4766364426a7239ad4725c8b9ac0ecd9 +size 86160 diff --git a/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_BaseColor.uasset b/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_BaseColor.uasset new file mode 100644 index 0000000..8a7a37e --- /dev/null +++ b/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_BaseColor.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64f29cd4e860727511187a85ccf62f8575a16843347af1c8054499b560406055 +size 197503 diff --git a/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_Normal.uasset b/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_Normal.uasset new file mode 100644 index 0000000..c7948d8 --- /dev/null +++ b/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_Normal.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74aa94a1936dd1478f9c5b1be990b4641f54ad5db3e703dfbfe53024bb523491 +size 209304 diff --git a/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_OcclusionRoughnessMetallic.uasset b/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_OcclusionRoughnessMetallic.uasset new file mode 100644 index 0000000..6a3da23 --- /dev/null +++ b/SeagullGame/Content/John/Material/John_standing_geared_uo_standardSurface1_OcclusionRoughnessMetallic.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61ef3e087c448e5ae37fef7c9493952ed7ee07760f5e3edaf0290248caf1c6e4 +size 282461 diff --git a/SeagullGame/Content/John/Material/M_JohnGearedUp.uasset b/SeagullGame/Content/John/Material/M_JohnGearedUp.uasset new file mode 100644 index 0000000..87f8f1c --- /dev/null +++ b/SeagullGame/Content/John/Material/M_JohnGearedUp.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf97a41932e7f215683bfe704c821356a2be1751964e0d80072065561f99ba68 +size 12913 diff --git a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp index bf7cdd1..14f76f5 100644 --- a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp +++ b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp @@ -15,6 +15,7 @@ #include "GameFramework/SpringArmComponent.h" #include "Materials/Material.h" #include "Engine/World.h" +#include "Kismet/GameplayStatics.h" ASeagullGameCharacter::ASeagullGameCharacter() { @@ -92,7 +93,12 @@ void ASeagullGameCharacter::Tick(float DeltaSeconds) void ASeagullGameCharacter::BeginPlay() { Super::BeginPlay(); - + TArray Johns; + UGameplayStatics::GetAllActorsWithTag(GetWorld(), FName("John"), Johns); + if (Johns.Num() > 0) + { + John = Johns[0]; + } //Add Input Mapping Context if (APlayerController* PlayerController = Cast(Controller)) { @@ -145,10 +151,11 @@ void ASeagullGameCharacter::StartGame() CravingItemActor = GetWorld()->SpawnActor(ItemActor); CurrentCraving = Cast(CravingItemActor)->ItemType; CravingItemActor->SetActorEnableCollision(false); - USkeletalMeshComponent* MeshComponent = GetMesh(); + if (!IsValid(John)) return; + UStaticMeshComponent* MeshComponent = Cast(John->GetComponentByClass(UStaticMeshComponent::StaticClass())); if (!MeshComponent->HasAnySockets()) return; CravingItemActor->AttachToComponent(MeshComponent, FAttachmentTransformRules::SnapToTargetNotIncludingScale, "CravingSocket"); - }, 30, true, 3); + }, 60, true, 2); } void ASeagullGameCharacter::EndGame() @@ -210,6 +217,7 @@ void ASeagullGameCharacter::DropItem() CurrentItem->DetachFromActor(FDetachmentTransformRules::KeepWorldTransform); FVector DropLocation = MeshComponent->GetSocketLocation("ItemSocket"); DropLocation += GetActorForwardVector() * 100; + DropLocation += GetActorUpVector() * 50; GetWorld()->SpawnActor(Cast(CurrentItem)->ItemNoPhysics, &DropLocation); CurrentItem->Destroy(); CurrentItem = nullptr; diff --git a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h index df7a478..d8bcb3f 100644 --- a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h +++ b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h @@ -123,6 +123,8 @@ public: UPROPERTY(BlueprintReadOnly, Category = "Item") AActor* CravingItemActor; + UPROPERTY(BlueprintReadOnly, Category = "John") + AActor* John; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John") float JohnsCurrentHunger = 0; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "John")