#blueprint
402296 messages ยท Page 841 of 403
If you need to call a function on an actor, would it be better to use blueprint interface messages rather than casting?
casting would be preferred almost always
interfaces are expensive compared to casts and given that they lack logical implementations, it's rare that they need to be used
I thought casting loads the entire object including meshes, components etc., so interfaces are still worse?
I don't know where you heard that, but casting does no such thing
casting runs up (or down) the hierarchy in search of the class to see if it's compatible
Ive heard many people say it, as an explanation for soft object references
so at worst you're looking at a running time of O(n) where n is the size of the hierarchy
it's nonsense
the variable in question is a pointer
loading an object and casting it are two separate things
i read it from epics website, saying that even if the casts fail everything has to be loaded
by the time you're casting an object it's already loaded, unless it's a static class cast
thought so, it reeked of bs or misinformation
see my reply above
gotcha, thanks
a BP cast costs about as much performance as a branch
a little more than that
but ballpark
I assumed the way casts work is it would find the pointer to the UObject you need, and if you are getting a pointer, that means its in memory
most things from epic treat casting as the boogie man
i thought it was a load of crap
could always avoid casting and make everything in 1 bp
haha
character, weapon systems, timers, all in one AActor
in general casting should be performed with some degree of caution, especially in code
but it's nonsense to say that it's more expensive than an interface call
the rule of thumb is if you can make it a hierarchy, use the hierarchy
if you can't, use an interface
gotcha, thanks a ton for the clarification
I don't think i have ever needed an interface
I generally have interactables stem from one master class, then specialise that logic where needed
there's different ways of doing it
having a hierarchy of interactables is an OK way of doing things
I tend to use components to give interactables interaction and contain the logic, which allows them to register themselves to the player's interaction manger
which makes the workflow as simple as adding an interactable component any time I need that level of functionality
Are there more ways to integrate c++ into blueprint other than inheriting a custom class ?
and that will be the same whether it's an NPC or an item
what do you want to integrate?
I don't know why this was aimed at me, but you can make custom blueprint nodes
Accidently
ah lol
Yea sorry i wanted to reply to something you've said about interfaces but ended up writhing another thing
set of variables?
use a struct then in c++
I think I need more context to understand the situation
you can already have a set of variables in BP
could be what i was looking for
if you can explain what you're trying to do you may get better answers
It is related to the get/set question i had
you can't make C# properties
i've seen an example to something like i wanted to do
you can approximate them
but they can't be generic
in the way you have them in C#
BP doesn't even support generics
and cpp doesn't support properties
so you'd have to make them based on a custom class
and then you're in macro or function library territory
but you could always write a struct in c++ and use the provided get set methods
structs in BP are generally meant to be read only
writing to a BP struct is not recommended
and a struct isn't the same as a C# property
which is basically a variable that allows for special custom get/set methods that can do more than conventional get/set methods
ah, not done much c# outside of very basics, but doesn't change the fact that it doesn't exist in c++
I mean epic made interfaces for UE, as those don't exist in cpp either
so I guess they could make properties at some point
but I wouldn't bank on it
it would also require BPs to have access to generics, which I'm not sure they are willing to do
i really appreciate all of the information, even though i struggle with the definition of some words
I assume you're coming from unity because of the concepts you're mentioning
a generic is a type of parameter that takes any type of variable
no generics
in macros they are available, but macros suffer from other issues
you could try using a macro as a custom getter/setter
There can be a macro in blueprint with generics?
very interesting
it's the closest thing you get
If i want to simply have one specific variable of a specific type, it would be much simpler?
also of course arrays, maps and sets allow for any types
do you have actual use cases for what you want to do? it would be much easier to explain then
lets say i have a string, each time it gets updated i want to run a save function
give me an example where you would use that in a game
because maybe you're trying to take a unity technical concept and translate it directly
which may not be possible
that's why I'm asking for use cases
rather than technical questions
I know there are other ways of doing it, but for example you've changed the character name, it would automatically update
Because the string "character name" had changed
if you change a character's name you don't need to change it until the user commits
so when they press "enter", that's when you can do that functionality
that's why character name is not the best example
In my case,
i make a productivity software using ue4
well then give me the example you want to use it in
I think widgets have some delegates exposed for that. but other than that you'd have to create your own widget type
in cpp
ofcourse there would be a countdown that would figure if you left it alone for few second before saving
So inheritance is the solution here
...no
you didn't meant inheriting a widget class? "creating your own widget type"
sorry i misunderstood
you could do that but it's got nothing to do with what you want to do. but OK, sure. let's say you inherit from the text block widget. you'd still need to create a delegate that is called every time text is entered
you would then be able to bind that delegate to any function you would need
first step would be to see which delegates are already available for textblock/rich text block
I think my questions were answered, thank you very much
How do I get started with using the Text Box (Multi-Line) Widget in UMG in Unreal Engine 4 Blueprints?
Source Files: https://github.com/MWadstein/wtf-hdi-files
2:07, there's an OnTextChanged delegate
so you could try using that
That's probably the best way to achieve what i wanted to do
sorry, whats the event thing that starts when the blueprint enters the scene?
I thought it was event ready but no, its not
found it, beginplay i think, please lmk if its not and im dumb for using it otherwise thank you
Hi all, im trying to make a very simple quest state system that progresses in a linear stage (stage 1 to 2 to 3 etc). I have the logic for progressing the stages and all that done, but I'm struggling to come up with a good way to have things happen when progressing to a new stage (such as activating/deactivating objects, spawning/despawning, etc).
What i have now is just a big switch that uses the stage index, and it works ok, but if i need to rearrange the order of the quest or add new stages in it's very unwieldy. Picture attached
Does anybody have any ideas how I could make this a little more user friendly? It does not need to be overly robust - im not building an RPG.
maybe a structure array? the structure could contain an index for each logic and the array index would be the order?. kinda confusing but it would look like this...
then you could insert new array indexs or even set array element
Yep, I think thats a winner. thanks heaps!
actually, maybe even better, i can switch on string instead and use the stage names
do collision objects parented to a mesh in a player character not have collision?
I think they have to be children of the character?
ive only ever seen it set up like this or something along those lines
but they should have collisions at least, perhaps your checking for collisions too low down the hierarchy? idk
Does it matter what year version I get?
yeah but if you wanted to add collision to certain mesh components, how would that work?
Well here the collision is done by capsule component here. I'm hardly profficient but I'd imagine you'd need more collision objects like the capsule
yeah, ill look around, thanks for the help
no worries
Is it possible to remotely bind events?
Lets say i have actor A, and it has some logic that at some point,
would use actor B reference to bind "actor B event" to "actor B dispatcher", and all that at actor A event graph.
I can open actor A event graph, add cast to actor B node => bind event to "actor B dispatcher".
But now how do i reference the event(actor B event) i want to bind? Not possible?
I'm using instance static meshes in a blueprint actor to create a procedurally generated map. I've gotten what I need from that but I need a way to procedurally place lights around the map and cannot find a way to do so. I have a blueprint actor with the static mesh/light source but I don't know how to repeat it throughout the map without hand placing all of them. Any ideas?
you should try bpi instead, you broadcast and send it any receivers however you like. No need to get and bind. Just need to know of bpi and have the event setup for when it should fire.
Oh jeez, I'm only just now seeing this, sorry
Yeah, I'm not sure why though. Did I set it up incorrectly?
https://www.youtube.com/watch?v=IAem3gztZ7g&ab_channel=Crimson @gentle nebula ~11:00 this part covers that if i understand your question right
In this tutorial, I'll go through the process of making a simple interaction system using Blueprint Interfaces. Feel free to ask any questions and provide feedback if you feel like certain spots aren't explained well since I want to improve in creating these kinds of tutorials!
Line Traces: https://docs.unrealengine.com/4.26/en-US/InteractiveEx...
Which leads into my question, so i have an object detect when it is interacted with, is there any way to get which blueprint interacted with it?
In this case i have a piece of food that the player can select by pressing e while pointing at it, I would like its response to be altering the players health in this occassion (and in this case the player blueprint is the thing that casts the ray that selects it)
or i guess the better way to phrase it is how do i find the actor that is colliding with my box collision?
Interaction systems are usually done via Interfaces, where the player doesn't have to care about what they trace
They simply call an Interface function on the traced actor
And if that actor implements the interface and that function, it can do stuff
E.g. your piece of food can implement something like OnInteract, which passes the Player who interacted along, and change the heath in the override
I haven't looked at that video though
this uses interfaces
I think the issue may actually be print not... well printing?
anywhere at all
wait now its working
wat lol
You could always update your interaction interface to include the interacting actor, then when you interact, you just pass a reference to self through it.
Then im sure you might aswell just cast it from the get go
i think ive narrowed down the problem
this is when i cast the ray, i see it collide but the print statement never prints
so the hit actor doesnt implement
the does have the interface
^
wdym?
the guy in the video didnt select that either
doing it now
ah that works! He musta cut it
never trust youtube tuts ๐
Or maybe im too blind, but i did look at that part specifically so idk
trust us ๐
well thank you! Saved my from scrapping this one
well.. the validating check is breaking, but it should be on a layer where the only thing that can collide is the the interaction sooo
goodby validated get ig
oop bad idea
lmao
got ue5?
yep
Stack'O'Bot can be a nice project to look at
relatively well commented
there's a livestream going through it aswell
ooh maybe, but right now I'm just trying to learn as i code. Tutorials are usually pretty rough for me which is why im struggling here but the docs for unreal are..
well not much compared to past engines?
the docs for unreal are.. unreal indeed
oh back to square zero, i've got the interaction working, i just need a reference to whoever is doing the interacting
and for some reason a variable with my player character just doesnt work
How come you need that reference?
so character raycasts object using interact
then i try to call back to the character to add a variable
then the character receives
right so you do implementation both ways
Variable is a reference to a character
Idk how to hand over the reference through the interface
im just not sure this is the way i suppose ?
If this is some consumable
Either you consume it directly,
or you add it to some inventory
if its ment to be added to an inventory
it'd be better to use some struct of GameplayTag and just pass that to the character
And what would the better way to consume it directly? Ideally I'd be able to select it with a raycast and be able to pull info from it
GameplayTag? havent heard of that, I'll take a look
Its a Tag in a nice hierarchy
Item.Fish.Fillet ๐
has a few handy functions to it aswell, with compare tag, compare exact etc
there's also containers for them
which can contain several at the same time etc
I'll have to look into that, looks good
But would there be a way included with that to detect which tag im selecting with the raycast?
The object would return its tag
okay good good
there are many ways to do this, im generally not using interfaces so im not sure whats common here ,
If you want the interaction code on the actor that is being interacted with, but want to manipulate something with the actor that did the interaction, you can add an input pin on the interface. If you have a common class that all your characters share, then use that class as the input type for the interactor. You can then pass back whatever you like to the interactor, or get whatever data you need from it.
Oh I appreciate the suggestions
I'll have to look into that, already scrapped the code but doing it properly from the start may result in a better outcome lol
I think using the 'Create Event' node should work
Pass in Actor B as the 'Object' parameter and select the event that you want to bind from the dropdown list
Less accuracy
I'm not entirely sure but I can imagine stretched textures?
if thats fine, then no
I need some help when I drag and drop a pawn from the content browser onto the level the movement works but when I spawn a pawn onto the level it does not move and I turned auto possess AI to placed in world or spawned but that doesnt seem to work
Are you using Spawn Actor From Class?
yes this is inside my UI widget that I am using to spawn the actor
Or wait, that's set actor location. I'm confused. You asked about a pawn moving, but this is spawning a building and setting actor location directly?
Sorry I meant spawning actors and then getting them to move
Hey, is it hard to replace the character in the ue4 templates with, idk, for example a cube?
so I can move that around instead
attempting to select a texture based off the vertexcolor i have stored... cant seem to figure out a way in the material editor. Anyone have suggestions? I'm hoping for somewhat of a multiplexor, where i can put in 0-255 and get one of 256 textures...
Hi guys, I need your help. I would like to measure how many time different control rig takes when my level is launched.
I start to take a look to the Timers, is it a good way? Are there other ways?
Hey guys, Is there a correct way to insert at "index" when using a map? without generating 2 arrays...
yes yes I was using it the wrong way
If I want index it has to be the key
thanks
hey Can I use "attach component to component" with "Blend"?
As in interp moving to socket position?
yes
You could keep the world position when attaching to component, get the relative position, and then do the VInterp To the socket position.
is there a way to pause a behaviour tree after starting it?
Hey, how can i get the location of the sequencer camera in a blueprint file?
I'm currently using the level blueprint and directly referencing the camera actor but it doesnt actually update the location when my sequence is playing, it just says x:0,y:0,z:0
youll notice it says 'unknown' this keeps happening every few minutes
as well
where the reference to the actor just becomes 'unknown'
trying to have an object in the scene always face the camera
i am using a level sequence
thing ive circled in red is what im trying to get always face the cine camera
Hey folks, I'm capturing world depth into a RT to use as a rain occlusion method. You can see here it is working, but because of the fact the capture is happening out of sync with the character movement, you can see it flicker/wobble as you move around. Is there any decent way around this?
One thought I did have, was to snap the scene capture between 'grid' coordinates instead of moving perfectly with the character. It would mean less RT draws as well of course. As the player moves around, the 'nearest' grid point is taken, set the position of the scene capture 2d, and update the material on it's location?
(For what it's worth this RT will be used for other things as well, not just rain occlusion)
Moving the tick group did help a little (makes it less intense), but it's still there sadly
Reason I'm asking here is the grid snapping approach will take some time, and I don't want to overcomplicate it if there is an easier way to stabalise the result
I think at this point you may be fighting with the graphics renderer
which for good reason isn't exposed to BP
probably some variation on z fighting
hi I have event dispatcher in a widget, and it is successfuly binding, all casting is fine but for some reason when i call the dispatcher from the widget the custom even it's bound to isn't firing pls help
F insulin isn't firing
time to get the epipen ready ๐
can you show the full code? what is setting up the dispatcher?
right but what is setting up the bind event? which event is that? and where is that being called from?
bind event is setting up by begin play in level blueprint.
this is getting called from a widget. I have its ref in widget controll bcs its easier for me
right but like I said I can't see what's going on so it's really hard to give any sort of advice
if you're under NDA I'd take it up with the team you're working with instead of posting here
Really sounds like the binding isnt working in the first place
I'd suggest to clean it up, if not for everyone else then for your own sanity
hm maybe i have two instances of a widget one on top of the other and I am binding to one but trying to fire from the other one
on accident
Having an issue. I made a function to spawn a Tile Map and then a function to spawn a background behind it. I then added a Delay and Destroy Actor to delete these after 20 seconds. My issue is the Tile Map gets destroyed but not the Background. Why could this be?
How to get Widgets they was Added dynamically on Viewport, get Fullsized ? , like in Editor i can doo it easily per Anchor, but at Runtime its not that easy, even if i edit Anchor Data thats not working like in editor
maybe you are spawning the background not as a component of this actor so it doesn't belong to tile map, but maybe you are spawning it as is it's own actor.
While when you call destroy actor, its pointing to itself so it just destroys the actor where it's called from.
Show the background event
The Background is a component of the actor in this Blueprint. I have it so the Background spawns at the same time as the Tile Map via the same trigger. Both the Background and Tile Map are components of the same actor.
Turns out it was incredibly easy. Just snap the scene capture to grid in the X+Y on tick, and splice in the player location for Z height, and use this as the world location for the texture rather than the player's. Completely seamless and no stuttering/wobble ๐
Both are components in the same Blueprint
yeah you can set it up in editor like that but when you call bp functions you can spawn it but it doesn't necesarilly belong to the actor where you call the function from.
show spawn background event.
I think you probably spawn it on accident as a seperate thing
So I couldn't put them both in their own function in the same Blueprint?
This is what I have. Maybe I have it setup wrong.
can you double click on spawn background?
and show me
It's just a simple setup to spawn the background.
oh yeah you see, you are calling spawn actor, Actors are independant from each other unless you create something like child actor component
Ok. So in this case what should I do?
so you are making a background actor which doesn't belong to the tile map actor
OK. I did not realize this. Blueprints are still new to me.
So do I add a Child Actor Component to the Component of the Tile Map?
I would recommend steering clear of child actor components
lol i use them a lot in my project
i heard they were unstable
but seems fine
they're bulky, buggy and perform terribly
spawning and attaching an actor is infinitely better
No sure how to do that.
spawn actor and then attach it
How do I attach?
Do I do it in the same Blueprint?
I've never done it before so I have no clue.
if you look for nodes with attach I think it's pretty self explanatory?
unless UE5 does things differently
try this
for the parent actor just write self and attach that, for target use your new spawned background actor
i think thats should work, never used it
So do I just use my next function after this? Like Spawn Tile Map Function --> Attack Actor --> Spawn Background Fucntion?
just put it after spawn actor in your spawn background event
Inside the function like Spawn Actor --> Attach?
yeah spawn actor to attachactortoactor
Ok. Like this?
oh yeah try that
It doesn't destroy it and it makes the Background spawn ahead of where it should be.
does any one know how to get the velocity moving away from a point
ok maybe instead of spawn actor you can do this
and remove attach actor to actor
It won't allow me to put a select node in the Class input. I have it selecting a background from 7 different backgrounds.
It won't even let me select a class that I have
ah ok I see
I tried searching up videos on YouTube but couldn't find anything, but I also just could not know what to look up exactly.
try snapping it to target instead of keeping it relative?
But where in the Blueprint do I put the Attach node?
Is there another way that I could do this where it still spawns as background and gets destroyed that I'm not thinking of?
Keep in mind that I'm not a Blueprint vetern, just a noob.
next to the spawn actor node? where else would you put it?
you spawn an actor, then you attach it
in the Background function?
what does the background function do? where is it located? how does it relate to spawning the actor?
Can't snap it to target because they'll overlap.
isn't that what you wanted?
No I want it to spawn where it is suppose to and then be destroyed after the 20 second delay. It's a background I don't want it to spawn ontop of the Tile Map in front of it
Ok I figured out the reason why my event wasnt firing so it's binding the event to the dispatcher which it didn't manage to create yet (lol)
basically it did step 2 before step 1.
delay fixed my issue
I don't know where "it is supposed to" spawn
code generally does what you tell it to do
Another way is so set a variable of the spawned actorBP then destroy actor using that variable
It's supposeot spawn behind the Tile map -50 units behind the Tile Map.
so if you don't want it spawned where you have it, change the transform to spawn where you want it
yeah you just call function called transform on the actor
It is spawning where I want it to. The problem is it won't be destroyed. Setting it to snap parent like you said makes it spawn ontop of the Tile Map which is not what I want.
where are you setting it to destroy?
What do you mean?
well if you want it to be destroyed, you have to set it to be destroyed
where is that being set? in which class?
I have it in the image I posted earlier but I'll upload another one
yeah that doesn't show which event is triggering that
also that just destroys the tilemap
I have no iodea what to show you then
so if that's what you want, sure
okay. set the background to be destroyed as well then?
the red box at the beginning of that execution is what we're looking for. that will tell us when the event is triggered
How? Where do I put that? I already put another destroy actor in there ontop of that one and it doesn't work.
That's at Begin Play.
cool
so 20 secs after beginplay you want it destroyed
when you spawn the background actor
take out the spawn pin and promote it to a variable
you can forego attaching it as it doesn't have relevance here
unless you want it to move with the tilemap
I have no idea what you mean by take out spawn pin and promote it to a variable.
the pin on the spawn node
No each spawn Tile Map has its own background and thus needs to be destroyed when the Tile Map is.
cool, so keeping that in mind can you try the above?
Yeah no problem, just don't know what you mean. What pin on the spawn nide?
the actor that is spawned
The Class pin?
Return Value?
pull it out, promote it to a variable
Ok.
Hello, I would like to input the letter F for example and print string hello, impossible to do it in a project from scratch but it works on the ThirdPersonCharacter in a Top View Project.
Only, impossible to redo it from 0 in an empty project
then target that variable with a destroy actor?
that would immediately destroy it
it was my understanding you want it destroy WITH the tilemap?
Hello i have a questiont that bothers me . Lets say you get the Vector location of a static mesh and you get its Z value , and compare it with the same static mesh but this time you get the VectorUp location . Whats the difference between those 2 ??
so once you have the variable, you can pull that variable string out and "bind to on destroyed" I believe
if the mesh is rotated, its local vector up will be relative to the rotation
so basically it will always pointing "up"
Up vector is a direction. The direction point up
Similar to forward vector and right vector
ok ty all
It works but ran into an issue though. I'm not sure how to describe this issue. I'll make a quick video for it.
No. 1=up. -1=down
the up direction is relative to the rotation. you can look at the blue arrow on the pivot
that's the local up vector
! perfect ty
note that your pivot needs to be in local mode for that to work
So here is the issue. It's towards the end of the video, but it shows it does destroy both the Tile Map and Background after 20 seconds but later it messes up.
global pivots will always point towards global up (0,0,1)
well the code performs as instructed. the tilemap gets destroyed after 20 seconds
Ok, so just increase the time.
or destroy it relative to player position?
That would work too, but how do I do that?
you could have a collision component on the tilemap positioned in such way that when the player overlaps, the tilemap gets destroyed
I don't know the parameters for your game, but if it's an endless runner I'd consider that
or equally, if the player leaves a collision volume, the tilemap gets destroyed
So just make another Collision Box and set it to Overlap Event and destroy said actors?
Wait that would just do the same thing
for coherence I'd probably do it on leaving the volume
so on collision end overlap > cast to player character > destroy tilemap
I see that there is an end overlap. Just put in the delay to make sure it doesn't destroy the current one the player is on and it should work
well no
OH?
delays are going to give you more issues like the one in the video
rather extend the collision box a little past the tilemap so you can be certain that the player is past it
OH. I never thought of that. My brain kept saying it couldn't go past but yeah of course it can.
I've never used the End Overlap before so I had no clue to even use it
just remember to cast to the player character
otherwise it will trigger on any overlap
including other tilemaps
Yes.
I'll do that now. Thank you for the help. Trying to learn something new sucks sometimes. I'm a 3D artist, just wanting to learn Blueprints so I can make my own games and not just games for other people.
Is this dumb?
yesn't
have to wait till widget control does its stuff duno how else to do this
the idea of polling is not bad, but you don't need to poll in this case
What's the opposite of 'Destroy Components'?
How can i get "hitresult under cursor" of two actors, one behind the other?
hit result is just a single trace so it will only return the first actor
add component?
Any alternative function to get the result i'm looking for?
you can extend the hit result trace by making another trace, ignoring the actor just hit and seeing about hitting the next
or make your own hit result under cursor implementation
There's also a Multi Trace node which returns all the hit actors in the trace line, not just the first one
hmmm, actually here's a better question that would solve most of my problems: is there a way to reset a BP so it goes back to how it was at the start?
that's what I meant by making your own implementation. hit result under cursor isn't compatible with multiline trace
kill it and spawn a new one in its place?
Sounds like a useful implementation to have, with the cursor
OH of course!! ๐คฆโโ๏ธ Thank you! :D
so 'Hit Result under cusor' is its own separate function?
I thought they were just asking how to get the hit result under cursor (as in the way of doing that)
it's an actual node yes
I didn't know that. I've been implementing it from scratch every time ๐
well now you know ๐
So it does work but the problem is they will destroy the current one the player is one. A delay could fix this but you said don't use a delay.
how have you placed the collisions?
in relation to the tilemaps?
during playtime in my game if you accidentally click on an enemy the game seems to lose focus. What could cause this
I placed it like this and it overlapping the edge, the problem is it'll just destroy the Tile Map and Background that the player is currently on.
Maybe I misunderstood you?
the placement looks good, how is your logic?
Just a sec
try putting a DoOnce after the cast
what does the "profile" stands for in the multi line trace by profile? Is that a collision preset?
So that didn't work. I'll take another video for you to see.
After looking into it, seems like it is
The beginning Tile Map just ignore that. That one is a separate Blueprint and is working properly.
I don't know why the second one is destroying at that point in time. do you still have a timer active?
can you put a print statement instead of the DoOnce?
No I don't have a timer active.
I can check.
I meant the initial 20 second delay
Oh I took that out because you said earlier that I shouldn't use it.
yeah just making sure it's not there
Nah it isn't. What is a Print Statement? Do you mean Print String?
You just want it to say something on the end overlap?
after the cast yes
if you can get display name of the tilemap
and hook it into the print string
How do I get it to display the name of the tilemap? I have 10 different ones it chooses from.
this is inside the tilemap actor
Oh I see just a sec
there is a function called get display name
But how do i get it to display the right one? It's a blue icon not a purple one
Hello Guys How I have a problem with this Gauge the rotation going from -180 to 180 once it reach -180 its start rotating weird i want to do the rotation from 0-360 ?
use quaternions
Hi I'm facing an issue, where if I have a widget open, very fast key presses don't always fire "released" events
is this a common thing?
I believe rotate around axis uses quaternions internally and will preserve correct rotation
yeah if you don't have an input buffer you can only have one released event per frame
so i have to make an .. input buffer? is that hard? ๐
it's not easy
So I have the Get Display Name into the Print String but I don't know how to get it to display the name of whichever Tile Map it chose of the 10.
the print string is inside the tilemap actor yes?
Yes
the tilemap actor knows its own name
'EventBeginPlay' activates when the game begins, right, not necessarily when the blueprint is created? Is there a 'EvenActorCreated' node or something that activates when an actor is created?
@glass stump its when the BP is created
beginplay activates when an actor begins play (e.g. when spawned) or when triggered by the game mode's begin play
the game mode is responsible for trigger beginplay on all other actors
It tells me I have to choose something int he Get Display Name
show me
ooooh. weird. ๐ค i do spawn actor, destroy actor to destroy an enemy and spawn a new one in it's place but the new one just stands there doing nothing.
sounds like you haven't setup some variables that you need for it
I have both Get Display Name Nodes in there.
use the blue one
leave it blank
But what do I put in there then because it only allows me to select sprites and images
.
Oh wait I see it allows me to select more
But still not sure what to put in there because I have 10 tile mapos and 7 backgrounds
are you not reading what I'm writing?
You said it knows its own name but when I play it doesn't print anything
Any simple way to have an actor constrained to a spline "rail"?
Nor when it end overlap
strange. in that case try with a "self" node hooked into the pin
I'm sure you can google this first
but simple? no
That works. You want a video for it?
just tell me what it prints
how many instances it prints, and what those instances are
even when 2 are destroyed like in your case?
Yes. Just the Tile Map. Should I put it after the Destroy Actor Nodes. Maybe that's why it only displays the Tile Map and not the Background with it.
it will give you an error if you put it after the destroy node
OK>
you're destroying the tilemap from inside the tilemap
so there is no execution past that point
experience is the bitterest teacher
if it's only triggering once, then the end overlap is working as intended
which the code also suggests
Agreed
so I don't know why the other tilemap gets destroyed at that point
it may be because where (as in, which class) the logic is situated in
I can put a delay again and see what happens.
To me it makes sense why it destroys the current one the player is on because this blueprint constantly spawns a new tilemap at begin overlap and thus it would destroy the current one and new one upon end overlap of the other collision box.
I could be wrong
so it should always destroy the one you're on.
you didn't tell me it spawned a new one on begin overlap
I thought I did a long time ago.
There are 2 Collision boxes. One is always set to begin overlap spawn a new Tile Map and Background, and then there is the new Collsion Box you told me to put in to overlap the edge so when it ends overlap it destroys the actor
One has to always spawn a new tile map hence the infinite runner
make the collision box extend the entire tilemap plus a buffer zone on each side and see if that works
Is it possible to have colliders interacting with each other based relation based rules?
Like having two balls roll down an hill, at the bottom there is a wall, one ball collide with the wall the other doesn't.
From my understanding colliders are set to either collide or not
The one that destroys I assume?
Yes. You can use additional collision channel and make the wall disregard said collision channel used by the other ball.
oh it's two separate ones? yes
but have it extend beyond the tilemap itself
Yeah two separate collision boxes. I did that and now I'll test it.
not just to edge of it
it only triggers once though
so the collision seems to work as intended
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Physics/Collision/Reference/
You can add your own response channels in ProjectSettings -> Collison
Didn't work.
Something I might have forgotten to tell you. The beginning Tile Map uses the same Tile Map Base Blueprint so it inherits the Collision Box that is for destroying. I think that may be the problem. Maybe if I create to different Tile Map Base Classes where one doesn't have that and that may solve the issue
i was about to reply, "Very helpful for me ๐ ", thank you!
you're not working with classes here, you're working with spawned instances
each instance has its own logic
and components
and each instance should be responsible for its own destruction
Ok. Sorry I use wrong terminology. I have the one Blueprint called BP_TileMapBase and every single Tile Map is a Child of that BP to Inherit from it. There is the Start Tile Map and Middle Tile Map BP's as Childs. The Start Tile Map spawn uses a different BP to spawn it on Begin Play while the Collision Box responsible for spawning a new Middle Tile Map spawns a new one after it is overlapped.
My thoughts are is that because the Start Tile Map has that Collision Box maybe it is causing the issue? Or should it only destroy that one and that one only and not that one and the next one that already spawned in?
I'm not sure if this helps.
what kind of children do you have? are these component children? are they attached?
The Tile Maps are just legit Child BPs of the the BP_TileMapBase as in Separate BPs, but this shouldn't be what's causing it because if that's the case then I'll never be able to get it working period. I want Inheritance to make my life easier if I want to change something among all of them.
okay so
there is a distinction between calling something a child and having it be inherited
when it's inheritance the better way to refer to them is super class and subclass
I just right click on the base BP and click Create Child Blueprint
OK
Again sorry for not knowing the correct terminology
so you have several subclasses
Yes
that's fine
this has nothing to do with the subclasses
we're concerned with how the instances are spawned, and where the logic for those instances are happening
each instance should be responsible for its own behavior only
OK..
The Start Tile Maps are spawned using a BP Actor class that I setup to always spawn a Start Tile Map on Begin Play. I have it Spawn Actor From Class and it is Selected from 10 Tile Maps and then spawns a Background from a selection of 7 Backgrounds. Once the Player reaches the Collision Box on Overlap it spawns a new Tile Map from the Middle Tile Map selection and Background.
I have the Start Tile Map on a delay of 20 seconds to Destroy Actor which always works, but after adding the Collison Box to Destroy Actor it destroys itself and then immediately the new Middle Tile Map.
I hope this helps. If not I'm not sure.,
if you still have the 20s delay thats probably whats killing it?
I took it out and now no Tile Map spawn.
Just give me a minute
I can't figure out why no Tile Map for the start is spawning. All variables have a Tile Map and the spawner is in the level. I already had to start over once. I don't want to have to again.
it's good to take a 30 min break from code sometimes
and you guys seem to be working on it for a longer time already
Need to figure it out. Been having an issue with it for days.
Try 24 hours 
So after taking out the Delay it no longer spawns a Start Tile Map, but if I put it back in without delay and take out one Destroy Actor and the references on the Target for Destroy Actor it now Spawns.
I got spawning to work again, but it has that Delay. without it it won't spawn for some reason.
I don't know what you're doing with that delay tbh. you'll have to deal with that yourself. removing delays should not cause these kinds of issues
It all started when trying to do a background separate from the Tile Map. Maybe to make my life easier I should just put a background directly on the Tile Maps. I wanted more randomness but screw it i guess.
you can have both. I don't think it's the backgrounds that are not working here
it's just whatever you're doing with that delay function
I have no idea how to fix it. No idea why taking that out would make it so the Start Tile Map wouldn't spawn.
I'd try using breakpoints and go from there
I'll have to look up what those are.
Mathew Wadstein has a good tutorial on them if you look for him
I've seen videos from him before. Good at explaining.
Like I said earlier this all started after doing backgrounds separate from Tile Maps. Before then everything worked fine even with delays.
I'll take a look at Breakpoints and see what happens.
right but I want to impress the point that regardless of whether it was working before doesn't preclude it from having issues that were just not visible then
Oh I know.
Is there another name for break points because I can't find videos from Mathew on it.
So Breakpoints is for debugging?
Unreal Engine 4.19 has added in more traditional Debugging Features to Blueprints such as the ability to Step in/over/out of Nodes as well as a Call Stack.
yes
breakpoints are for debugging issues at runtime
Thank you for the link. I couldn't find it because I was looking up breakpoints and not debugging.
I did think he had one on breakpoint specifically but I can't find it now either, sadly
Might have taken it down.
So I think what I'm going to do is go back to the beginning. Take out the spawn backgrounds and make sure there is nothing wrong with the Tile Map spawning and despawning first and then move forward.
@tender gorge You're trying to do something like this, correct?
Yes. I got it to work but I wanted to make Background Tile Maps to go along with it and that has created this whole issue. Of course there could have been something else for all I know.
Before I did the background tile maps I successfuly had a Start Tile Map spawn and then successfully had other Tile Maps spawn after and destroy themselves, but after trying to backgrounds that do the same thing there has been nothing but issues.
I did what I said with starting over. Took out the background stuff and delay and it all works 100%
very strange
The previous Tile Map is destroyed on End overlap
are the background just static meshes?
No they're Tile Maps as well.
I see
This is extremely strange I think. But it's the spawning and what not for the Backgrounds that are the issue.
I could have a separate spawning and BPs for them entirely just have a Overlap and End Overlap Collision Boxes that the player goes through to trigger those. This makes them independant of the Tile Maps the player runs on
In theory that should work 100%
Honeslty would make it more organized too
Ok but there is one issue I'm unsure about. So for the spawning of the Start Tile Maps they are suppose to spawn a Tile Map from a selection of 10 which are different from the Middle Tile Maps, but the strange thing is sometimes it will spawn one from the Middle Tile Map even though the variables it's pulling from are only for Start Tile Map.
I messed up. The BP had the wrong tile map.
I'm just going to make the background tile maps independent.
Still good to know about Breakpoints. In the end this is helping me learn more and I'm grateful for that, as well with the help that everyone has given me here today.
How would I be able to detect when my AI Agent can't reach the target?
IE a player leaving the nav mesh volume
Or detect a player outside the nav current nav mesh volume
Currently I'm detecting the closest player to designate as a target but if the player walks off the navmash platform it still registers as being a close player
I've looked in the nav mesh nodes and I don't see any nodes regarding if a point is reachable on mesh
I believe there's some pathing functions for the navmesh like "get nav path to target"
or something along those lines
Using this I found Get Path Cost and it returns a 0.0 float if it's unreachable
Found this old system when diggin through the project, Unreal Blueprints inside a Unreal game. It's shelved now. Hopefully it makes a return ๐
It's in c++ though, but thought it would be fun to share here
Very cool!
pretty sure this node did exactly that
You can made your own modding tools for your game, or custom game creation thing with that
Yea, I hope it sometimes gets re-added
๐
how can i make this work on multiplayer its day/night cycle from ytb
any way to fix "get mouse position" that gives wrong value when testing in the editor viewport?
Not "wrong". It's just giving mouse position scaled into 1920x1080 canvas.
I checked the viewport size, it is 1518x992, i can click on a corner and get 1629x1059
which shouldn't be possible
Are you running the game in editor?
yes
no way to get accurate numbers in the editor?
Figures.
Try testing in Standalone process instead.
Editor's Slate UI is put into account if you test right in editor or just use New Window.
Yes i've stated that this is my problem, editor, but everytime launching the game is taking time
Ill try new window
I'd rather go with the latter.
Standalone process is free of editor overheads and quirks.
But really would you rather wait that huge load time difference
By huge, you mean 5 to 30 seconds, absolutely. FWIW you get debugging results closer to shipping/actual consumer play environment.
Maybe i just like to tweek stuff a lot so that this 15 seconds feels like long time
Any way thank you for the help
anyone willing to answer a few noob questions, please DM me. Its about camera movement in a topdown game
Hello guys, i just started with unreal engine 4 and i did some animations for my 2d game but i came across a problem: how can i do a falling animation?, cuz i cant find a vector that checks the z value and i also tried searching it on the internet
If you're using a character, you're probably looking for Velocity. You want to dot product their velocity with VectorUp. < 0, you're falling. Though CMC also has an IsFalling function as well that may interest you.
Would it cause problems if i don't unbind events before destroying an actor? It shows an error in the log, but is that harmful?
I would think it wouldnt be gced due to still being referenced..
@icy dragon
Point taken:
Im fooling around in a topdown game, I made it so when I input Mouse X into axismapping it makes my camera move around my character. Problem is that I only want it to work when I have right mousebutton pressed, but right now it works with any mousebutton pressed
Plus if your destroying it you can always just "unbind all"
im currently using the "is falling" thing and thats the problem cuz i want a jumping and falling animation and with this method u can only get one of those
Noted. DotProduct the velocity then. If you DotProduct a normalized velocity with VectorUp, it will be below zero when velocity is going towards gravity.
ok thx
Get the local controller, and check if IsInputKeyDown, Key==RightMouseButton
I'm curious if that works with the default scheme setup for most of the templates where you have to hold down a button for the camera to work
It should on an AxisMapping. Basically tick.
the button press is not listed under action mappings, even though it is required
Not following?
Hi guys. Where is it more correct to create a main widget. In character or in HUD?
there's basically a mapping that's unaccounted for in the mappings where you have to press (and hold) down a mouse button to move the camera around. this is never explicitly mentioned as an action mapping, but it is required to do so anyway
Personal opinion is that most widgets should never be created outside of other widgets or the HUD class. Exceptions being stuff like a blank map with a main menu, or widgets that get auto created in WidgetComponents.
@maiden wadi Got it to work like this, thanks ๐
You can check if an action mapping button is required too. GetInputSettings, GetActionMappingsByName, ForEach through them and check if their key is pressed.
How i can refer to HUD class without cast?
Why would you avoid casting? HUD is always loaded.
right but like I said, the action mapping isn't there. but the input is required regardless
How do I edit to set a target point in the game as the default target point for the target point in the blueprints?
If your using a Aim Offset add some intermediate transition point.
Is the variable instance editable?
The CDO is the default object in which things are copied from to exist in world. This means you're trying to change this in the class. You can only edit this in an instance.
And Instance being a copy of the class that's been dropped into the world in the editor.
So I should edit the blueprints of the target points that have been dropped into the world?
Not sure. I don't know what you're doing. What is this actor with the TargetPoint1 property?
An enemy that uses the target points as a patrol path.
And you've dropped the enemy into the world in the viewport?
Yeah. But I need the enemy to get destroyed and spawn another of itself as a reset. It does that at the moment but it screws up the patrol path and just moves to the center of the map, then the game starts lagging massively for some reason.
I assumed it was because the patrol points aren't set on the new enemy that spawns.
Possibly a ton of movement update attempts.
Hard to say what best case is there. Initial thought is you could pass what you need to the spawner like the target point and set that in the next spawned enemy. Could also fake the death with a skeletal mesh spawn and not actually kill it but hide it and just reset it back to it's original state which means that pointer never gets nulled.
Ah, faking the death sounds good! I don't actually want it to get destroyed, but I didn't know how else to reset it back to it's beginning state.
Hmmmm, is it possible to do a component spawn?
To restore a destroyed component?
I think it's called AddComponent in blueprint.
Should have a list of all of them that are blueprintspawnable.
Hmmm, thank you I'll try this method! :)
anyone know a tool that can screenshot giant bp?
instead of manually panning and screenshotting and reassembling
Hi, is there a way to destroy actor inside an function?
Yes. But not in a Const function.
hmm
I have a timer macro, inside it creates an event.
But i can only use that macro one time on the event graph other wise i get an error for two events with the same name.
Anything i can do to fix this? Or am i doing it wrong?
Const implies that you have no intention of altering any state in an object with the function. This means affecting it in any way. Usually const functions are getters that simply retrieve information about the object.
Why are you creating the event there? Is this for binding a delegate?
i wanted to set a timer
So yes for a delegate i think
I am trying to spawn objects and rotate them. I notice they are clipping. How do I write something: if they clip to each other, to reposition the object to a position where they DON'T clip?
I've been trying sweep & teleport but to no avail, my items still clip & clip
Can you show the Macro? Because you should be able to use CreateEvent to specify the same function from multiple places in the same graph. You cannot have the same actual CustomEvent with the same name though.
It is bit messy
I can tell you why this happens - When dealing with macros, you need to think of them as the compiler copying and pasting the code where you've created said macro. By the sounds of it, you placed a Red event within the macro itself which will not function correctly.
Yep
And there it is.
I think i should use a function instead
Since it's in a macro, you could potentially use a delay node to simulate the timer. Just would require a bit of rework if you only want it to fire so many times.
Delay with a loop?
Yep
Last time i tried doing it it gave me an infinite loop error
Probably done something wrong
Some one explained me that the loop has to end before next frame
More correctly, the next frame won't ever happen if you cause an infinite loop. This used to crash entire systems. Modern operating systems just close the offending application now.
UE has a max limit of loop iterations
Would be difficult to describe the amount?
it's listed in... the project settings? the editor settings?
I think default is like 500,000. But it also depends on the UE4 version and whether they've fixed the counter. That 500,000 on some versions is more like 50,000.
I expected it to be much much larger
well we can all agree that it's over 9000
Wait, if i use set timer by function, i cannot input parameters to the function at every timer "tick"?
Anyway, i decided to just duplicate the entire macro so it would have an original event, since i couldn't think of another solution, even though it would've been nice to have
Hi again!
So, I made a topdown click to move game. Now I made it so that I can move the camera around the player, and also its possible to reset the camera by double click. But when I doubleclick, the camera is resetting instant, is there a way to make the camera-reset a little bit more smooth?
you'll have to do it over time
yeah, what action do I use for that?
there are different ways of doing that
I do something completely over the top because I have a complex camera system
but for starters using a timer or tick is fine
probably a timer is better just because it's easier to turn on and off
hmm, not really sure where to add that or the action name?
SetTimerByEvent
@odd ember I just did made the Backgrounds completely independent from the rest and now everything works 100%.Actors are destroyed when they should be, no delays are used either. Also it feels more organized too.
good stuff
hello guys, i have this horizontal box, and im adding a child box, how can center this box dynamically?
cause if a i have 5 theire not in the center of teh screeen
size to fit?
hmm
well you need to supply an event
Foreachloopwait is identical to foreachloop except it has an additional input where you manually can move to the next body if the loop (replacing bottom part of internal sequence)
the question is, can it persist for more than one frame
what are you trying to do
Sure, this makes it not reset insta, but my goal is for the reset to go back smooth, not like teleport back
i wanted to have a macro that work over time
i tried using set timer by event but then i limited to one macro for an event graph
so you probably want to loop it and then also use something like RinterpTo
again not what you want to do technically
what do you want to achieve
because right now you're trying to break the engine I'm pretty sure
I got it, i spoke technically because i achieved it but i just couldn't duplicate it.
Ye, it can persist as long as you desire
I want a countdown system that i can easily call whereever
Breaking the engine? Well that's easy. Just create an FText from an FString, and pass it back through a function, call that function and .ToString() the return in a Loop initation.
what do you want the countdown system to do?
is it a stop timer?
does the user invoke it?
isn't this just... a timer?
Not actually joking by the way. ๐ That crashes in shipping builds.
a complex one
actually no
I would suggest looking them up
Already at it!
but also if you just need a countdown you don't even need a timer
you can just compare game time at two points
but i want to to execute stuff at each moment
Timelines seems interesting
then timer, tick or timeline
Is this for UI or something else?
The countdown macro i wanted?
Yeah.
this xd #blueprint message
What is your HorizontalBox's containing parent?
another widget
Yeah. Which widget?
Different answer if it's a CanvasPanel or a VerticalBox for instance.
Make your HorizontalBox SizeToFit, and set it's X alignment to 0.5
Anchor it to center point or topcenter or whatever.
Will keep it in the center.
size to content = size to fit?
Yeah
thx it work
Does anyone has an easy way on how to stop the camera in first person view clipping through walls?
move the camera back
or extend the collision cylinder
The near clip plane in project settings is pretty high by default too. Can lower that to avoid it quite a bit more.
Hello guys i used the quaternion to get 360 degree rotation for the Gauge but also still broken .
I want relative rotation + Some value = set relative rotation
did you try with rotate around axis?
@odd ember So proud I actually got it to work like this! ๐
this is my Equation
I tried a function i will show you one sec
First i got a function from youtube converting Euler rotation to Quaternion
// Formula to convert a Euler angle in degrees to a quaternion rotation
FQuat URotation_Quat::Euler_To_Quaternion(FRotator Current_Rotation)
{
FQuat q; // Declare output quaternion
float yaw = Current_Rotation.Yaw * PI / 180; // Convert degrees to radians
float roll = Current_Rotation.Roll * PI / 180;
float pitch = Current_Rotation.Pitch * PI / 180;
double cy = cos(yaw * 0.5);
double sy = sin(yaw * 0.5);
double cr = cos(roll * 0.5);
double sr = sin(roll * 0.5);
double cp = cos(pitch * 0.5);
double sp = sin(pitch * 0.5);
q.W = cy * cr * cp + sy * sr * sp;
q.X = cy * sr * cp - sy * cr * sp;
q.Y = cy * cr * sp + sy * sr * cp;
q.Z = sy * cr * cp - cy * sr * sp;
return q; // Return the quaternion of the input Euler rotation
}
Hi all, I'm having difficulty figuring out how to load a level with a specific game mode. Does anyone know?
i.e. During runtime, I want to be able to open Level_A with either GameMode_Foo or GameMode_Bar
Hey everybody, quick question about player camera setup. I'm trying to get the player / capsule to move towards the camera facing direction once the player starts moving, but rotation does not behave like I expect it to.
Here is my setup:
Use Pawn Control Rotation: off
Use Controller Rotation Yawn: on
When I move camera 90 degrees, the capsule only seems to move 45 degrees. What am I missing here?
just use rotate around axis
I think this contains the solution: https://forums.unrealengine.com/t/gameinfo/41805
I guess "Get Control Rotation" returns full aim rotation which works on a different "scale" than "Get Actor Rotation"? If so, how would I normalize those values?
Hello everyone,
I made an inventory system recently and the way I initialise the chests is bothering me.
I have a list of structs containing a datatable (like equipments) and a name (the row line of the item), then I loop through to fill the chest with the items info. Is there a simple way to have a scrolling menu lets say when I select the datatable to choose the items from? (Right now I need to manually write the name without typo)
control rotation is the rotation of the player controller
which can be different than actor rotation
Is there a way of getting them onto the same scale?
Get data table rows?
hmmm, is there really no way to set the target point variable as a specific target point?
or access target point actors from a blueprint?
What do you mean?
the node
what are you trying to do?
Set the default target point variable within a BP as a target point that's in the level.
you cant use level specific actors on a template level
you can expose the variable and once placed in the level you can then add it
Exposing is this, right?
yes
Yes this is what I am using at initialisation, I was just thinking to simplify the way I am entering the names of the items. Is there a way to have a scrolling menu to choose from all the rows in the datatable? In the editor I mean, sorry I was not precise.
once you place that actor with the variable in world
you can look in the details panel and set that target point to be an actor in world
it has that built in
yeah but the actor gets destroyed and spawned again, so it loses the target point information from that specific iteration.
well then you need somehow find a way to transition that information
any ideas on how to put me in the right path?
I don't know enough about your project to say what would be a good way
ah fair enough, thank you
Oh yes thank you, I found the variable "Datatable row handle" !
Using "Set Absolute" it works
if you're spawning the actor somewhere you can expose the target point as a parameter on the spawn node
that is half the battle
the rest you have to find out yourself
ah thank you i'll look into it. :)
Hello I got an really tricky question. For example I got an collision sphere and if the player overlaps the collision sphere it will kill him. Then I got an wall but the collision sphere is really big. How can I make it that the wall will block the collision sphere for overlapping with the player?
Okay and then I make an boolean with CanHit for example and set it to true.
right?
I wouodnt bother with a variable, but sure
If theres a chance the player peeks over/around the wall, and thats supposed to kill him, you need to trace on tick btw
And if the trace ever hits the player -> byebye
how do i get the angle of a surface hit by a line trace?
Ill set of the collision sphere generate overlap event to true or false
Compare trace start and end as a unit vector dot product to the hit normal.
OnOverlap -> start timer
EndOverlap-> stop timer
Timer -> trace @crimson hornet
this is currently changing what is printed depending on elevation level.. Ive seen printed values of 400, and 4000 lol
Yet again i have a problem
alr
Refresh the event
Make a UnitVector. Start should be End, and Ending should be Start. You want it to point in the opposite direction that your trace was. Then you replace your Location in the current DotProduct with that.
GetUnitDirection I believe.
Yeah. From should be End on your HitResults.
To should be Start.
Basically creates a 1.0 length vector facing the opposing direction of your trace. If you use that in your DotProduct it should give you something > 1 usually since it's pretty difficult to hit from the other side. The closer to 1 this is, the more direct hit it was.
Right click it -> refresh node
what signature?
To should be Start, meaning the start of the hit location? I dont use impact normal at all?
The interface event
i belive that i changed it only in the interface
Should be this.
wow thanks for the screenshot. that is not what I understood at all
Delete and re-add the event ?
so this assumes I am sending a trace from the hit location bouncing outward, and outputing a value of 0-1? guess I should print the dot product and see.. Because the get unit direction node is using trace start which is just in front of the players camera
wish unreal slackers would allow 15 minute threads or something..
The idea is that you're basically putting a stick where you shot the trace and another stick facing directly out from the surface you hit. The closer your sticks are to facing the same direction the closer to 1 that float should be.
wow. Get unit direction node is 1 stick... where is the other one?
https://blueprintue.com/blueprint/9tnqs2wg/ This is whole Item BP
Going from 1 (identical direction) to -1 (opposing direction)
Facing directly out of the surface. For example if you shoot flat ground, that would be straight up.
impact normal dot product is the other stick?
Impact normal is the other stick.
Dot compares the two sticks
ooo
"How mich alike are these two vectors?"
dot product outputs a value of 0-1 depending on the difference then?
Yeah. Normally a DotProduct will be -1 to 1. In this case, you'll pretty much always be above zero. Hitting a surface from any angle enough to produce a zero or negative result would be rare.
so im trying to prevent players from placing a firepit on the underside of a roof lol
might make for a nice ceiling light
but that would output negative dotproduct yeah?
Yeah, that's a different check. ๐ In that case you want to check if your Normal is DotProduct to VectorUp greater than zero
Compare impact normal to world up
o gosh haha
You can dodge a step if the player is pointing upwards in general
In no situation can you aim upwards and hit placeable location for a firepit
to be clear, i do want to disable that kind of placement
Yeah
why not just prevent that based on surface normal
But instead of extra math
Id just check the aim direction initially
If aim direction is downwards, then check the surface normal
Probably a micro optimization, ignore it ๐
Which component would make an object be given physics so it can fall down?
collision sphere, capsule, or box with physics checkbox on.
VectorUp in this case is your UnitDirection. So you just DotProduct VectorUp with the ImpactNormal.
.5 would be 45 degrees
Hi. Looks like variables exposed from Designer by Is Variable are always public. What's the point? why can't it be made private?
60 degrees*
45 degrees is .707
heck yes. thanks so much guys/non-binaries.
Yeah, it's basically the sin(a)
Ah, the more you know! i stand corrected:)
I mean cos... ๐
No
yes, fixing them
That's wrong
I already fixed them
Still floating around
then you didn't fix them ๐
I did..
not if they show up no
You are wrong, these are from previous sessions, still showing
restart the editor
but also why didn't you just clear them when they first appeared
some very strange workflows
guys sorry , how can i pick a unique random value with a for loop ?, is picking but this repeat values
Because, i was testing how my blueprint works, it required me to press the mouse many time, which generated those errors.
Yes you could say i should have fixed the error before continuing to test.
Is that what you think?
I don't think anything. I'm working with the information you give
either you get the error again or you didn't clean up your errors
You asked, so i answered
and of course *i tried to understand why it is strange
I don't need to really
Anyone know of a way I can set Self Shadow Only at runtime? By default you can only access the get. Not sure if it's modifiable via another function call.
guys can someone plz send me a blueprint of how to switch between a jumping and falling animation in 2d cuz i tried all day and its not working
I wouldn't know if it's exposed to set via blueprint or properties. have you checked the documentation?
perhaps you could try in #animation ?
You mean only with collisions coming from one direction?
plz tell me what i did wrong here
there's one thing coming to my mind(maybe others would provide a better solution)
Make the logic to determine the direction of collision by calculating the relative speed(either of two object, if both are moving, or the one object that is moving), and if it is from the direction you want, set the channel for the collision
my animations just stop when i walk and jump