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) | |
*/ |
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
void ChangeMaterial(UMaterial *material) | |
{ | |
TArray<UStaticMeshComponent*> meshes; | |
GetComponents<UStaticMeshComponent>(meshes); //Get all the mesh components | |
for (UStaticMeshComponent *mesh : meshes) | |
mesh->SetMaterial(0, material); //For each mesh component, set the material (the 0 is the element index of the material) | |
} |
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
/* | |
IMPORTANT! | |
In order to be able to use this functions, in the file "YourProject.h" change this: | |
#include "EngineMinimal.h" | |
For this: | |
#include "Engine.h" |
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
/* | |
a shader executes per pixel | |
so every thing you see here is he function for every pixel | |
raymarching is in principe a function that finds the closest point to any surface in the world | |
then we move our point by that distance and use the same function, | |
the function will probably be closer to an object in the world every time | |
and after about 40 to 200 iterations you'll either have found an object or | |
missed them all into infinity |
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
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
//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
//En el constructor (no el BeginPlay) | |
UTexture2D *texture; | |
static ConstructorHelpers::FObjectFinder<UTexture2D> Texture(TEXT("/Game/StarterContent/Textures/T_Spark_Core.T_Spark_Core")); | |
texture = Texture.Object; |