This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UComponentType *myComponent; | |
TArray<UComponentType*> comps; | |
actor->GetComponents(comps); | |
if (comps.Num() > 0) myComponent = comps[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Input name //Function to handle the input | |
this->InputComponent->BindAxis("MoveForward", this, &UMyActor::HandleVerticalAxis); | |
void UMyActor::HandleVerticalAxis(float v) | |
{ | |
//v is the float value for the input | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- GameMode, make sure none of them is null | |
- Null pointer exceptions | |
- Having instantiated in the level the same PlayerBP than the one in GameMode | |
(so when the game starts the GameMode puts another one and it gets duplicated ) | |
- Having BAD CODE(code that can cause a crash), even on startup. Ye, if u have bad code it can crash on startup!!! UE4 does some sort of prebuild or something. Beware of putting code on the constructor that must go in the BeginPlay instead, this happened to me <3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//From the actor's viewport (camera) | |
FVector2D result; | |
UGameplayStatics::GetPlayerController(actor, 0)->ProjectWorldLocationToScreen(pointInWorld, result); | |
//result now has the screen point(x,y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UGameplayStatics::GetPlayerController(actor, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
character->InputComponent->BindAction("Jump", IE_Pressed, this, &AMyCharacter::HandleJump); | |
character->InputComponent->BindAction("Jump", IE_Released, this, &AMyCharacter::HandleJump); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPROPERTY(EditAnywhere, Category=Pawn) | |
float speed; | |
UFUNCTION(BlueprintCallable, Category=Attachment) | |
void do() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UFUNCTION: https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Reference/Functions/index.html | |
RAY TRACING: https://wiki.unrealengine.com/Trace_Functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buttonTwoDatesPayments.setOnClickListener(new View.OnClickListener() { | |
public void onClick(View v) | |
{ | |
Calendar c = Calendar.getInstance(); | |
int mYear = c.get(Calendar.YEAR); | |
int mMonth = c.get(Calendar.MONTH); | |
int mDay = c.get(Calendar.DAY_OF_MONTH); | |
DatePickerDialog datePicker = new DatePickerDialog( MainActivity.act, | |
new DatePickerDialog.OnDateSetListener() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The key to this is to make a normal UMG, but use the Blueprint function SetAnchors, where Minimum and Maximum inputs to this function go from 0.0 -> 1.0 (normalized screen size). | |
For example, if I want to put an UMG which only occupies the right bottom corner of the screen, I would use: | |
SetAnchors, where Minimum = (0.5, 0.5) and Maximum = (1.0, 1.0) | |
*/ |
OlderNewer