#blueprint
402296 messages ยท Page 833 of 403
ok
You can instead access everyone's HUD from the Array of PS with the Controller and update the value like that
oh
One of the only times GetPlayerController with Index is useful in a networked situation, in the GameState
if I need the number on the HUD to move up in a counter like fashion. Do I bind it? because I saw a YT video that says it updates every tick and that's not good or something
Rather than my rotation going from 0 to 360, then looping back.. which is what i need, it's going into the negatives.. makes it quite hard to calculate
Cause if you iterate all PS, you can access all PC like that
Does anyone know how to get an instanced position? I want the instnaced mesh that gets rolled over to set its location to a lower value in the z axis. Sorry for my wack english im tired haha. But i just want the mesh to get a lower value so it looks like it got rick rolled over :D.
Get instance transform
So from the cast -> get instance transform -> subtract your z and update it
Carefull not the mark renderstate dirty more than once per tick
Its an expensive operation, especially at volumes
i see artheur told me to use and im still a bit confused at what it does
Updates the rendered meshes
I suppose that means sending the new transform array to the gpu or smth
ok but i do need that ticked if i want to change an instances location?
If you want it to show, yes
But if you roll over several instances on a frame,
You only need want to mark it dirty once
so if i do it each second it would update all the ones it had run over and set the new location on them all
It will update their appearance yes. Their actual transforms will update regardless , not sure about their collision state
hmm interesting. I would need it to update fast but maybe not as fast as i am doing right now
The more instances you got in the hit component the worde it gets
If this is foliage im not sure how thats handled in that regard
If it automatically divides it at somr generic instance amount or if it just keeps piling on..
ok
this is the setup atm but like they all get a large lower value
this is good but i wanna have more control do i need a value a little bit lower than 1
You could lay them flat in the direction they got rolled over ๐
hmm what do you mean?
You can update their rotations
So they are like 80 degrees tilted in the direction they got rolled over
And perhaps scaled to .8 or smth
Idk, perhaps dumb idea
yeah i see what you mean
So I have a little text widget that displays the name of the item the player is standing over/on
it works but the problem is
It will display the names over all the items of that class or parents untill I walk over all the item currently in the world
then it works properly
any idea how to make this only display over the single actor
before vs after walking over them
all of them*
Also tried this (not hooked up atm)
@tawdry basalt Maked a mistake here.
The timeline playrate not fine yet becauseif the start Z value is negative and the find look at rot Z positive (or first pos 2nd negativ) then the difference will be not good. Resolved this with this macro. Simply checked if both of them are positive or negative, if yes then subtract the output from input if not, then add them (with this we will get 90 with 10,100 values and -40,50 values too).
https://blueprintue.com/blueprint/e_4w2-fc/
Set the display as hidden by default?
Then nothing shows at all
maybe this guy instead?
lol that makes it so everything but what im standing on shows
I gotta make an asset randomizer for an in-game store today. i.e. Every so often the options displayed in the store widget change and allow the player to buy different things.
I was considering making one class for weapons and setting the mesh and stats from a data table or data asset.
Other method I'm considering is make each weapon a child class and just use get derived classes to populate a list of possible options and spawn them from there
Thoughts?
@tranquil abyss HiddenInGame needs set to true by default for the component.
Also don't mess with the literal Visibility unless you really need to. Try to avoid it where possible because it's a replicated state. HiddenInGame achieves the same thing and is not a replicated property.
gotcha
Im not sure what you mean by hidden in game
like the visibility setting for the widget
If you have it set up like this, then you're only showing or hiding the component if the player overlaps and ends overlap. The "Hidden in Game" value should be set true on the component by default as both I and Authaer mentioned.
This.
Click Widget, go to details, check HiddenInGame.
ohh
That sets it's state to true by default. So it's invisible when you start playing. That makes it so you don't have to overlap it first to set it's hiddeningame to false on end overrlap before it actually hides.
You have three different visibility settings when messing with WidgetComponents. SceneComponent has Visibility and HiddenInGame, and the widget it's holding also has it's own ESlateVisibility settings that can hide the widget itself.
test
that was weird My message was getting blocked
?? im trying to upload a pic in the engine
weird
Anyways. It works
but a bug if I stand on 2 items it displays the same name for both
that wont happen very often I dont think but still a bug
Totally basic UE BP question - but how do I create folders in the Variables section? ("My Character" and "Components" seen here.)
Set their category
WTB way to not have variables in folders. ๐ฆ Passing components to widgets is annoying.
Does anyone have an idea for a build system. Something lay down foundations and so on.
Oh, and I'll be in the Lounge channel
Calls category, click on it, u can write a new name, it will create a new category write something which already exist, it will put there, u can create subcategory with using | like this:
Components|Guns with this in components category will be a Guns subcategory. Dont use space, because it will create Components category with space. So dont write something like this: Components | Guns.
https://streamable.com/9x2vfr
is it possible to do what I am doing in the video in a simpler way without losing the effect I was hoping I could make a function where I could just pass in the rows I want to animate and how long of a delay but timelines can't be in functions so I'm stumped on making this easier without just making it open instantly
either make an event which takes the actor as parameter
or put them all in an array and iterate over it in the timeline update
I'm trying to compare a set of numbers based on my objects rotation, but my object rotation is super out of wack, i tried using a clamp axis so it'd go from 0-360 but it's making zero sense still
<@&213101288538374145>
Wasn't for you.
Ah, whew.
You'll get a warning and severely mocked before you get mods called on you most times in here. ๐
๐ sounds good
Mod tag was for the discord nitro spammers.
yeah, it's just so i could visualize the number easier
i'll remove it once i have this fixed
how do you rotate the wheel?
an event ๐ค hmmm I know how to make custom events but never made one with parameters damn let me try
Get components by tag > For each > cast to StaticMeshComponent > AddLocalRotation
thanks, i hate it
you should show the whole graph setup which is involved in that rotation stuff, as i can't yet twist my head around what you are doing
and i would use setRotation instead of addRotation, later might flip some axis which would lead to your result
๐
I'm not wise enough yet to even spot the problem lol, for sure though
Spoiler(ered) for gore /j
you are setting local/relative rotation, but you compare world rotation
don't do that
either one or the other, considering the use case you may use relative/local rotation everywhere
Ahh, ๐คฆโโ๏ธ. Obvious oversight
so like, on this branch, i have the same functions copy pasted, and when its false it works, and when its true it says target variable has accessed none so does nothing and gives me an error
Set rotation? To what? A variable that increases with time? At a certain point it would pass 360 though, do i just set it back to 0 after that point?
what in the blueprint is going on
just fix the other issue first before you think of more
does it still happen if you compare against relative rotation?
I didn't know there was a getlocalrotation node, what's it called?
without seeing close menu my guess would be something is trying to access something you destroy after you do so maybe showing close menu will help me be clearer
get relative rotation probably
https://discordapp.com/channels/187217643009212416/221798862938046464/940718746874556416
Anyone have an opinion, advice, anything?
i'll send it over now
I'm only seeing Get Relative Transform 
well then take that and split the transform
for now
honestly i'm not sure if local rotation is relative rotation (but i guess it is)
here it si
As a UI programmer, I vote DataAsset. Much more scalable. Much easier to modify and set up the data you want to display. Allows designers to change things as well with nothing but data input.
in the previous picture you were passing in a target variable but in this screenshot I don't see it being passed in?
for some reason it works no problem when the branch hits false
thats where im getting confused at
ah my bad yeah it's an event not a function and hmmm
is it possible the event is getting called more than once? maybe add an is valid?
Yup, still acting quite odd. Might be what you said though, adding instead of setting. The way it's acting currently, it can never reach 90 to 135
ok, so i have changed the names a bit to clear things up
are you setting the target reference correct on the button which has the name "Yes"
so have a look now
i think actually showing you guys this has made me realise my issue
I'm new to blueprints and UE in general, does anyone know any good tutorials for beginners on key press events that play animations on characters?
on the first image of the three i belive i have not casted to all of the buttons
that's usually what does it for me xD
just the initial one on the first index (0)
ah yep get child at 0 only does the 0 index if you have multiple
when i try doing a play animation it doesn't do anything when I try to press the button I set to for the event
yes my dude
i love how explaining things can sometimes help you see the issues
thanks for being there and asking questions about my issue!
Is it possible to set a key press event inside of a metahuman blueprint? Like if the metahuman is the playable character then is it possible to make an event that triggers one of the character's animations when a keyboard key is pressed?
I tried to set up the event in there but it doesn't give me the option
Like one of these action events; how do I use that?
Thanks! :)
@maiden wadi Just to clarify, you'd do the child classes with a data asset over a data table and single item class?
Single class with a data asset would be my preference.
I'm confused.
How would that work for populating a store front and spawning the items?
@spark steppe well good news is this works but only on the last ones called so child 1 it works but not child 0 and so on so if there were 63 it would only work on the last one
Are we talking 3D store or widgets? You mentioned meshes, but also widgets, so just clearing that up.
It's a faux website like Amazon the player accesses to buy items that will then be air dropped into the world.
I need to be able to randomize which items are currently displayed on the website widget and use the choice to spawn the corresponding item
yea i might have sent you on a goose chase by accident
guess the timeline which gets evaluated is the same for all
but i'm not 100% sure on this
yeah i think your right I'd need a separate timeline for each group of objects I wish I could like instance timelines so have a parent type of timeline and then instance one for each loop
you had two timelines before because the 2nd row should run with a delay?
Personally, my items are all tagged with gameplay tags. So I would just have a tag container. Maybe a few depending on item types. Would only need to randomize those. 3D actor or widget can pull up whatever else from static data to display. At most you might have to map the tags to prices or other data maybe. I suppose you could do the same thing with softclass refs to your items.
yeah each row essentially does the exact same thing (copy pasted timelines) but with offsets for delay
Hello, how would I go about getting a players relation to spot in a spline maybe this picture helps? :
can someone give me a idea to calculate the distance between 2 objects pls. I want to do one thing and need help. When i press the punch button i wanna to move the character close to the point that he gonna hit. Is it possible?
Vector 3 distance
thx
Why does this print decimal value instead of 1, 2, 3, 4 ....
Truncate it before you print it
it keeps printing 0 multiple times
It'll print 0 till the value is 1.0 or above
What does it print if the time node is plugged directly
it prints decimal values
I think it's a constant
and yeah after a bit of time it goes above 1
but now i want to move characther to the cilinder location. how do i do that?
but I don't know how to use the Curve I made for my timer still. Like I have my max value on the curve being at 900 sec and its value is 23 (11PM).
And at 300 sec (6AM) I need it to go faster so I don't know how to work with those values
@maiden wadiDon't tags just maintain a data table and check against it?
@spark steppe well I sorta found a work around using the event style but just in a node grouping copy and pasting it seems to be functioning and it's not too bad manually connecting them to the pins at least
how do i move my character to a location?
heya, quick question is there any way I can replay a BP's functions? like after my ball goes across the goal I want it to replay the same delay into randomly thrown movement.
what I have now is when it goes across the goal it sets off a custom event to be set back at it's original location with set actor location
For anyone wanting to know the location on a spline closest to point; Tags closest to Player, Spline, Rotate, look at
I couldn't find it on google
Is it possible to have a switch case on the Box Collisions I dropped in the world and use "Get All Actors of Class" and I want to compare the output array with some tags and depending the tag on the box collision i want to execute some different code
Can you explain what it is you need to go faster?
A curve is just like any graph you've probably ever worked with in math.... You input a value for X, you get an output of Y. There's no real "faster" involved with reading a value out of a graph.
I'd also be wary of doing something like this.... You could always make your own trigger actor and program in a bit of logic into it so it can handle things by itself.
I need a reference to those triggers in the gamemode
So I have this logic to show the name of weapon when the player is standing over it, It works the problem is when I hold the weapon in my hand it shows the name still, I added the cast to and the branch to not show it, That works only issue is the widget is still overriding the othe widgets that im standing over.
if I swing it resets and the color displays correctly
Hope this makes sense
You can have them report themselves into the game mode, but not sure why you would necessarily need to have them in the game mode.
how ?
I think you need to separate out your logic a bit better...
OnActorBeginOverlap > If Character's Equipped Weapon == self > FALSE > Set Hidden if "Overlapped Actors" doesn't contain player--- hard to understand.
vs.
If Character's equipped weapon == self > set hidden true (as I imagine the name should never display if equipped and it happens to end an overlap, but overlaps with your character again).
You may also want to call a function that sets it hidden when it gets equipped as the OnOverlapEnd event may not get called when you attach it to your player to try and set it hidden.
๐ง
ill need to make a function in the player ig
when the item get set as equipped
On BeginPlay of the actors. You can call GetGameMode cast to your game mode, add themselves to an array, or call functions in the game mode to do whatever Again, doesn't seem like it would normally be something you really need in the game mode directly. What are these triggers supposed to do?
I need to enable and disable them at certain time and as it's a multiplayer game I need to do that in the Game Mode
could you go dm ?
Actors can maintain themselves based on events - all gameplay logic does not need to be in the game mode for multiplayer. It can actually be much more cumbersome to deal with if you have your game mode handling things that it doesn't need to. If you have a manager that handles time within your game mode, that's fine.... Have it call an event dispatcher when something needs to happen, and create your own trigger actors that bind to it on their begin play... Further to this, in your game state create a function or event that takes a Name or gameplaytag as input that you can then call from the triggers when they are triggered - feed in a tag or gameplay tag that you set on the triggers when they are capable of being triggered. In the gamestate, handle the event, and switch on name or gameplay tag and then you can do whatever you need to do, and if anything needs to be replicated to players you're in a decent spot to do so as well.
So now, you just need to place your trigger actors, they automatically bind to the time when placed so they can be enabled and disabled, and when enabled and triggered they'll pass on the event to the game state to handle whatever needs to handle, and perhaps notify players that the thing was triggered.
And sorry, I don't like to work in DMs.. If you have questions, your best bet is to ask them here.
What is Ue4's equivalent to Slerp?
I want to emulate Lag like the spring arm
Never mind it's Vinterp
I still have the problem with my timer, it's still not accurant and don't know how to solve that
What's the inaccuracy currently?
my day has to be exactly 10 min (so from 6 AM to 11 PM it has to be 10 IRL min) and the night exactly 5 IRL min (from 11PM to 6 AM) and my timer is at 10 min when it's 10:50 PM instead of 11 PM and 5 min when it's 6:40 AM instead of 6 AM
like the 10 and 5 min are variables and from that I calculate a ratio to use in the SetTimerByEvent
show where you call those events
You add 0 to 1 all time that's why
remove the argument from the event
and just drag your score variable and drag it above the + 1 (where you have the "Add Score" thing)
How are you doing the clock?
ie. What's keeping track of the time right now?
is there a way to pass parameters to events?
i have a Parent who can collect many orbs.
the orbs can decide to leave the parent
the parent therefore needs to know which orb has left
the parent stores an array of orbs, and the orbs have a parent property to know who its currently attached to.
is there a way to get the orb to inform its parent that hey i left?
Sure, on your event add an input. You can set the type of variable and what have you. In your case, make an event on the parent, and the orb can then call the event on their parent and feed in a reference to themselves.
or better yet - can i make the Orb's Anchor property be a publisher? so whenever the anchor property changes - it always invokes a stream ala ReactiveX
For some reason my get arrays aren't updating, always staying at the same value.. are they only being ran once? (Connected to a branch at the end)
thanks! is it possible to do this instead?
makes for a unidirectional flow
Hmm?
^
Like you want an event when the value changes? There's nothing really like that...If you're setting the value, then you can also call whatever you need to from there usually. If you wanted to use an event dispatcher, that's an option, but then you have to have your parent bind before calling it.
(swift syntax, apologies)
struct Parent {
var children: Array<Child>
var subscribers: Set<AnyCancellable>
func attachChild(_ child: Child) {
children.append(child)
child.anchor = self
child.$anchor
.sink {
if let newValue = $0, newValue != self {
children.remove(child)
} else if newValue == nil {
children.remove(child)
}
}
.store(in: &subscribers)
}
}
struct Child {
var anchor: CurrentValueSubject<Parent?>
}
$anchor refers to the stream of the child's current value.
sink = setup a subscription to the stream
store = a way to keep the subscription pointer around so that it doesnt get deallocated (swift uses reference counting)
this code says - parent observes child's anchor property - if it changes and its no longer the parent, then the parent says ok i update my array to remove the child.
(i have never tried C++ yet so im not sure if this is even possible - but it seems like there is RXCPP so there might be some notion of reactive programming)
I think event dispatcher is what would be similar, but it doesn't automatically broadcast - you have to call them whenever you want them to fire so you could have a setter function set up that you ensure you use and in that function you set the value of the variable and call the event dispatcher.... But then the issue is again you need to bind and unbind from the dispatcher as well which would need to be handled within the object receiving the event before the event is called. You could maybe manage something like that in C++, but nothing like that in blueprints.
Well your orbs know your parent already.... So call function on parent prior to setting parent to None.
i see
the code above is actually a bad example - usually the child shouldnt know its Parent - should be a protocol (aka interface in C++?)
to remove cyclic dependencies
but i digress haha probably trying to over engineer blueprints here
Well, it is good to have decoupled code.... I was thinking about an interface as well, just in case you wanted to have different classes interacting with your orbs.
aye
oke for a start i will just go with this - thank you!
hard to resist "this is bad code" instinct heh
also - is this the wrong way to use generics in macros?
was trying to make a generic Find Nearest Actor function
seems to not return the value at all
... am i overreaching by diving into generics straight away :X
what is it ticking on?
event tick
i see, but what class is that event tick on
i have 3 classes
BP_NPC (contains OrbCollector component)
BP_OrbCollector (a scene component)
BP_Orb
the event ticks on BP_OrbCollector
oh the function also.. sorry, there's a lot there, I don't see it off hand
BP_OrbCollector invokes Find Nearest Actor in its event tick
does anyone know why my montage is playing indefinately? figured this is more of a blueprint question
nevermind im dumb, i was calling the montage again in my animation notify state
copy pasta errors are fun
Is it not possible to make a bp function's return type be a set?
Love pasta errors
they are the best
When changing the variable type it only allows me to change it to either a single or array. both set and map are greyed out
Change the variable type first (perhaps it's on boolean?)
ah yes you're right
what is the default value of a local float in a macro
Ohh my variable was a struct. I'm guessing structs can't be sets
is it always 0?
is there such a thing as an optional local float in a macro?
i guess i could just simulate it with a local boolean
works like a charm now - thank you all
@wintry gazelle you can make and set or set members in struct
Am i doing something wrong here? My object keeps spasming out once it reaches a certain rotation
do i need to have two MoveTo branches that accept different parameters?
is there a better way to do this - cant seem to figure out how to get Flow control to do this
ah
select vector
@weak zealot depends if you want x and z to be unchanged or set to 0 like you're doing
set to 0 is what i'm aiming for, yup
Oh you're pry hitting gimbal lock
Select node
I'm only rotating around the y axis
Gimble lock? It starts spasming.. nearly stuck in place
is this a blueprint bug?
i set it to select if not null - but the debugger complains im trying to access a null value
or does select demand the data eagerly
Selects still try to grab the appropriate values.
Yeah that's gimble lock. it has to do with how it calculates the rotation. I'm blanking on how to fix it without a quaternion
like a switch / pattern matching operation
Solution is just to use an "IsValid" node
Hmm. Any resources you could link me to? I haven't heard of this
btw is there an easy way to duplicate a node in bp editor
like alt left click drag in viewport
Control w with node selected
Ahh yea not sure about mac can mac control c then control v
๐ฆ bruh moment
seems to be far better supportedf
i'm casting a player character which is taken in as a parameter and yet it's not recognizing it as one lol
The execution pin needs used
#ue4 #beginner #blueprint #rotation #flight
Quick and easy fix to overcome gimbal lock for any game requiring the full 6 degrees of freedom!
Everything in this tutorial can be accomplished with no knowledge of c++. The code used to create the custom functions can be found below:
tyty
Or convert to pure cast with right click if you know itll validate
i should really experiment before asking lol
i always figure it out after i ask the question lmao
like literally the second after
XD
oh wow you can control the branch of nodes by clicking along its node
... my ocd is satisfied
there has to be a better way right... some sort of tool to auto-format blueprints?
They have plugins like electric nodes or whatever but reroute nodes works just more work can highlight 2 nodes and align them as well so wire is straight
I have a 5mb csv file loaded into a data-table. Instead of showing all in a single scrolbox, I want to use pagination.
i see
btw - how does the Ai Move To command work?
why does it not need to be ticked on?
how can i create functions that can tap into Event Tick, but without having to explicitly connect to it?
timers arent ideal for movement because it gets affected by varying tick rate, so what's a better alternative?
and is there a way to make an optional parameter e.g. vector in a blueprint?
Why would you want it separate from tick? If the frame rate drops and movement doesn't then the lag will be more noticeable
i dont want it to be separate from tick - but i want to have the ergonomics of calling MoveTo() from beginPlay / or anywhere else
without having to connect Event Tick
e.g.
i have to do this
instead of saying - please move to location X. go hook up to a event tick urself
AI Move To has this ability
it simply accepts a callback then hooks into event tick itself
its a lot more ergonomic to use than having to create event ticks everywhere
basically - i wanna create my own MoveTo function with the ergonomics of AI Move To
Ok, I don't know if you can do that in BP
BP functions don't really handle time logic
You can't just use the ai node?
its an orb with only a scene component
i think ai nodes need to have movement component?
Nah has to have an ai controller tho
ah so i guess they probably use the controller to handle that logic
and their controller hooks into event tick then
Probably since inputs are on tick
can this be done?
Idk, never tried..
Not too much is impossible tho
Might be more work than it's worth tho
strange. thought these would be really fundamental ergonomic nodes
is optional not really a thing in c++?
I mean they gave you tick as an option..
You could probably dig into it and figure something out, but I'm not really sure why bother.
Not like it'll save performance or be any faster
hmm
I'm working on a new project after some time away from using Unreal, so hoping someone can give me a little nudge in the right direction. I'm working on a project where my Twitch chat can have a little character that will take part in the game (think like a meeple in terms of complexity). The character will have about 5 unique variables bound to it. Think it'd be best to use a pawn for this? Or make a master BP with something else and just create children off it?
Actually now that I've said that out loud I should just make an actor and not be dense.
why does SpawnActor not respect the scale of my actor's component?
it seems to set the scale to 1 instead of keep it at 0.25
well you may notice the "scale" input in the make transform
yes - how do i get it to respect its original scale defined in the BP?
Just set the transform settings to be as you want
So far as I know, you can either set it manually to .25 ahead of time, or if you're wanting to be able to change it on the fly you'll need to cast to and set the value before spawn using whatever flavour method you're keen on.
nvm i think the solution was to create another scene
and make the sphere a child of the scene rather than the root
is there a node that allows me to change a float from
0...1 -> 1...0 alternating - but accepts an ever increasing value e.g. tick seconds.
or do i need to manually create a function for this
e.g
0.5 = 0.5, 1.5 = 0.5, 1.3 = 0.7
oh
timeline
hey anyone know how i can trigger a combo-box on ue4 to play audio would be a big help
Like, when you open the combo box?
yeah like depending on the selected option it plays a different song
Is there a way to prevent a pawn pushing another pawn without turning off collision?
Either of these will work... You'd need to use some concurrency settings if you want them to not play overtop of one another.
how can i add concurrency settings
Hit the little triangle on the Play Sound 2D node and there'll be a spot to feed in a concurrency object. You'll have to create a concurrency class in your content browser.
ahhh ok thanks!
ok i still hear two musics playing at the same time
nvm i got the issue thanks for the help i met a deadline thank you so much
does anyone know how to fix this?
#ue4-general message
hey so, i need to have a list where each item on the list casts an event when selected, and i need to scroll through them one at a time. how would i do that?
Tags are just a comparison data type. Same as an FName or Integer or Strings. It's no different than older games using Integers or Strings. If you've messed around cheating older games, you often spawn items by their integer ID. It just looks that item's data up using that key. So if that's what you mean by that, then yean. GameplayTags just have the benefit of both being an integer, and named, and tiered. In the end it doesn't matter what you're using for a key. If you're not organizing your game items into tables or data assets against a lookup key in some way, you're going to have a really bad time managing them, and specially creating UI for them.
Hi all, is there a way to apply material changes on a staticMeshActor back to the StaticMesh Asset in editor?
Probably some form of editor widget could do it.
Do you know where I might find a solution online / what to search for?
I've done some blueprint based plugins but no C++ yet so I probably won't be able to create the solution myself at this time
No idea. I don't normally do editor level stuff.
Hi! Does anyone know how to make parent class blueprint receive overlap events that happen with its child blueprint components?
i have houses with various sizes / shapes, doors in random places so i made them a parent class (from static mesh actor) that has no components in order to classify them all as houses (initially for another reason). But now i need to check if my pawn enters the house. But the overlap events do not reach the parent blueprint because it has no components to overlap. I enabled overlap events but nothing happens because it only has an empty static mesh component.
I think opening up every child blueprint and getting overlap events to trigger there is kind of stupid / repetitive last way option (i have bunch of houses), maybe there is a better way to access from the parent? I can access child actor components in beginplay and display their names (image) but i can not track their component overlap events..
Any ideas?
I've found a fiddly but usable method, with printing out the replaced material name alongside the default mesh material slot name
How can i move a actor to a location? and doing a animation while not there
That's probably what you'll have to do, yes.
hey guys, could I ask how do I make a static mesh from actor rotate forever (like helicopter blades for example)? Thanks for help
can someone help me pls
current would be current actor location, set the actor location to the return value of the interp
I'm not sure if you can inherit the parents overlap... But you could create a function/event in your parent and have that pass all the data
then you can implement it in your child blueprints however you like
First of all, why would you want to move a characters mesh?
that's going to break all the collision etc
Instead of the branch, just save the value as a boolean and branch on event tick with what I've shown above
no i dont want move the mesh, just made that that to get a condition, but ok
doing that
These docs are most likely just decals btw, disabling depth test only works for translucent for obvious reasons (solid objects always render closest)
I'll move question to right channel.
yes and that way you know when to move the character in your event tick
so now i need to do what you made up there?
and now how do i move to a location?
my character*
how do i move a character to a location?
btw thanks for all the help everyone. just completed this level ๐
how do i get my current controlled pawns transform as a variable?
get controlled pawn > get actor transform?
ah
thanks :)
and then plugging that in to "set" will set it when the set is run?
@native linden what do you mean with "set"? use SetActorTransform node for that. There is also Get|SetActorLocation if it's the only thing you'd like to change
has your pawn a movementComponent attached? then you would do this differently
it works :)
Hello, I have a problem, I previously made a Character Customization Screen, it changes the skeletal mesh it works completely fine, but when I click play (Which redirects to loading a level), the character class has the default skeletal mesh
Hey quick question. I have a Editor Utility Widget that I would like to call some function on. But I would like to call them from a plain UObject to keep my architecture clean. I cannot do that because when the function is declared in a Editor Utility Widget it is then automatically EFunctionFlags FUNC_EditorOnly. Any way to get rid of this flag on a UFUNCTION? Or to make the UObject also be editor only?
Ohla!!!
I have seen a few tutorials on "chest opening", but in the interest of not creating the same problem as I did last time I came here... i tried to do it on my own ๐
interestingly.... I got some results!
Also, interestingly, I have some results that do not make sense
I have a BP, that has a collision box, when you enter the box is sets "isUsable" to true (bool)
on end over overlap, it sets the bool to false
I have a print string to show that either of those events are happening, and they are
what is wrong with the top part....
its not firing either string
@magic parcelYou've never enabled Input.
@maiden wadi , how would I do that?
You call it on the player's local controller.
Yeah. And pass the local controller in.
before, or after the branch?
interesting
it his because its not on the player controller?
(first time doing something like this)
Because actors shouldn't take input
Pawn or character can by default
Use an interaction interface and have that tell the chest to open
hm...
so the main "coder" of the project does that (i am the artist learning to code)
Look up blueprint interface
but i didnt see how I would hook into that
he has the inferface created and uses it for weapon pickup
Actors can take input. It's actually how the system was designed to be used.
Basically the button press will only work when there's something controlling it. You don't control the box. So you have to interact with the box external from the thing you do control.
But in this particular case, traces and an interface are much better.
A good example is players weapons. It's much cleaner to add ownership to the weapon and enable input in it, and put the fire event in the weapon then go passing shit through multiple classes just to call fire.
Yeah. You want to add an interface Interactable or Useable. Implement it on the box. Then on your player controller or pawn/character, add a "use" or "interact" trigger, which does a ray trace out from the camera (or wherever appropriate.) If it hits something, check if it's "usable" or "interactable" and then call the "use" or "interact" method.
hm...
okay, I will have a go at it
i want to avoid trace
i hate when I am in PUBG or other games where I need to look at the object
instead of being able to focus on the area in front of me. So, that is why I am going with overlap
so i can keep looking at the area I need to focus, but still pick up the object if I desire to
Check the way Dying Light 2 does it.
You can sphere trace around the character so it doesn't matter which way your looking
@tawdry surge i saw that method too
It basically checks every item on screen within grabbing distance and interacts with the one closest to the centre.
which is interesting
but then how do you pick up the item you want if there are 50 of them ๐
Multi trace and a for loop
Fucking hell my typing is terrible today.
i call the event Interact
to the branch
then from the branch to whatever I need done
in the interact, i put the bind for the button input (e) in this case
I would do a sphere multitrace based on your camera's location, check what's got the smallest angle to your camera's view rotation and interact with that.
btw, seriously, i appreciate your help on this. All of you. So inviting and welcoming! makes me want to learn more code ๐
Heya. Is there any way of just detaching an item from hand and leaving item to drop on the floor using physics? I am casting line trace to find the floor now and detaching the object if floor is founded but it's ugly and item is teleporting on ground :D
(and avoid angles over, say, 60 degrees)
I thought there would be an easier way of just releasing the object
Moonrider: spawn another actor and move the component to it
But I'll have 2 actors that way
@vagrant flicker If you enable physics on the item it'll just fall
Assuming it's third person, swap the object with an actor with the same mesh, with physics simulation enabled, ignoring character collisions.
just enable physics, easiest way ๐
@vagrant flicker Actors tend to represent a single unit, a person, an object, an idea (oh the imagination!)
and set character NOT to collide
cause if you enable physics and the character and it overlap, its going to fly
or make your character fly
lol... that is always fun when that happens
Actually it's anything that can be placed on the map.
Well, technically, you can add a component without an actor. It will just crash the engine in most cases ๐
Actors are inherited from UObject, and the latter can't be placed on the map/level.
Thanks guys, I'll give it a shot
so, before I go fucking up my entire player controller
should this trace be done on the player controller?
correct?
that is what it sounded like
Yeah.
k, here we go! (cue mario sound)
I usually do it from the character since it's what I want as the starting point
Hi, I have two actors, one is added to the other via child actor component and it's root component is a static mesh. Now, I'm setting the mesh for the child actor's static mesh component via the construction script of the parent actor. And I can see the mesh in the editor just fine, but in the viewport of the parent actor there's no child actor mesh visible... Is there a way to see stuff in the viewport that's set/added/spawned via construction script?
Controller may or may not be at the pawn location
so not the controller, but the player character ?
@keen hedge a drawback of the child actor components is that the actual child actor isn't available in construction scripts of the parent
@magic parcel it's up to you, either is good, depends on your code.
Just do it wherever the weapon interface is at so you can piggy back off that
k
thanks ๐
ill give it a go and see how it works
I got cars to work last night, so.... why couldnt I get this work tonight ๐
This is easier than physics for sure
How do I get the value after the decimal on a float? 13.25, how would I get just the .25?
Subtract it with the truncated number of itself
I believe you misunderstood. My issue is that the parent receives no overlap, parent has no components. Children receive the overlaps but i want to write the logic inside the parent. So i want children to somehow tell the parent "hey, someone entered", but i have bunch of children and i don't want to write same logic to every child :/
Actor overlap doesn't work
Should fire if any child component is overlapped as well
Thank you โค๏ธ
My little analog clock works now lol
I tried asking for overlap event from parent but nothing happens
Nevermind got it
OnActorBeginOverlap (StaticMeshComponent) inside the parent, created a simple print function and nothing happens. In beginplay everything prints and i can access child components from specific child. Generate overlap events is turned on, and collison is overlapall, StaticMesh is empty, since children inherit it anyway
No. Not the component one. The default on actor begin overlap. For the whole actor
oh i never really used that one
Hello everyone, quick question, does anyone know of an alternative to Pawn sensing for a player looking at a pawn?
Hi, I'm implementing a video playback system in a widget, so far I get everything working as I like.
The only issue is that the media texture is not initialized when I construct the widget for the first time. I set the image size by getting the resolution of media texture.
After the initial launching of the widget, the texture size is set properly as it can now read the media texture properties.
How can I initialize the media texture before the widget asks for the resolution?
i called a print function for it and seems like nothing happened. You meant this, right? technically it should call the event when overlapping the child of that blueprint as well, right?
It should. That's odd
i had to walk around a bit, seems to work now
thanks!
so i made this, and now on true i want to move the character to a location. How do i do that?
does anyone know how this node works?
I'm pretty sure it says on the tin
tin?
it says what it does pretty clearly
^
I guess you don't have any actors with that tag then?
I have 9 actors that match that tag
are they of the type you have supplied?
are they spawned at at the time you are making the query?
yes from dropdown so i couldnt of got the wrong type
they are spawned before
pretty sure
I mean the dropdown doesn't mean that you can't pick a type that doesn't have the tag
event construct sets the tags for my blueprints
let me check again
maybe that's the issue? that the tags aren't set?
get all actors of class with tag works, so i dont think its the tags
its a bit more complicated on how I set the tags so im not sure if it will confuse if I post it
switch on enum then this
nope
This is gonna take a fair bit to work out
Ideally I want the HUD widget removed when the player hits 0 health, and then have the Game Over Widget replace it
I think the node just doesn't work
I assume you would need to add the 'You Died' widget to viewport for it to be visible
If a UFunction is set to blueprint callable, can it still be called through c++?
Yes
hm odd, someone reported it couldn't be, thank you
You can't reference anything from BP in C++.
the node mana regen is done in cpp
How can i view my objects rotational gimble? I'm trying to get around gimble lock
yeah but u can do it the other way around
in my project i use helper classes just for bp functions that are slow
^
Why not a timer instead of tick?
what does that mean? :x
Anything done in BP can't be referenced back to C++
thats the way id do it. cuz pure c++ is just a waste. BPs are really good for ez stuff. unreal is cool cuz a good workflow involves using both
if u had a variable called Health in ur bp, you could not access that from any c++ class
ok, what about a plugin in c++? that should be referenceable in c++ no?
pure C++ is just a waste
haven't done that but yeah probably?
C++ referencing to C++ is possible.
C++ referencing to BP is possible.
BP referencing to C++ is NOT possible.
you mean C++ ^?
yeah he meansthat
but yeah i get it
Sike, I ninja'd you.
oh no!
C++ to C++ u have to make the class u want to reference public. its good practice to only create one way dependencies
oh... maybe i didn't make it public
UFUNCTION(BlueprintCallable, Category = "AAA")
void ToggleTraceCheck(bool CanTraceInput);```
since i didn't say public, it's inherently private, right?
oh wow i am in the wrong channel... my bad
Hello blueprinters, I'd like to create a system where players can send bug reports in-game. Ideally, I'd send a bunch of data and their feedback to a google sheets document. Any ideas how I would go about doing this?
If you know C++ and built the engine from source, you can modify Crash Report Client to send bug reports to you.
Hello, I would like to make a battle pass system but I don't really know how to go about it. In particular, I want to give people the possibility to see the time remaining before the end of the season in real time (like on Brawl Stars)
Lose the tick. Trigger the delay on BeginPlay and then loop the Set back into the delay. That way you're only running blueprints when you need, rather than every tick
You would do the comparison entirely in server side.
?
I'm working on a saving/loading system in Blueprints, I've got it properly saving/loading player xyz and the level the player is on. However, I can't seem to get it to properly save/load the camera's rotation.
Bottom is the camera's rotation when I save, top is the camera's rotation when I load that save.
Usually games don't bother with this, but what you're looking for is Control Rotation instead.
Would that be off of the character, or off of the camera manager?
Looks like I found it, but just to confirm - Get Player Character, Cast to, Get Control Rotation?
I don't think you have to cast for that
Hm.. Looks like it's still not working on my end. Maybe I'm doing it wrong?
Here's how I have it set up for saving
And for loading
99% of the time it's the setup
A variable named "Time" and using SetTimerByEvent
Has anyone here worked with datatables. I need to loop threw all records. and return only the ones that have recipes. and then display the Name and Icon for that recipe.
it's just I'm using 2 for each loops and I want to do this with just 1 loop
just 1 array for the recipes. and I' using the data table to get the records for each item
that has a recipe.
the array of records is also an array
so you have: array of records > array of recipes
so you need two loops for that
Ok, this is how I start it
ok, this is the 2nd loop and ends the 2nd loop, I think
so there's another data table?
in the second screenshot you're getting a different struct
which would imply a different data table
which is probably why you're getting an error?
Ok, After the 1 loops it gets all the records 1 at the time. Then this happens
This checks to see if it has recipes, If Yes. then it starts another loop to get the recipes and then displays the results. Your saying some thing it wrong here
This part loops threw the recipes.
Looking up the official documentation on that node, I found this. Since my project is in Third Person, could this be part of why it isn't saving/loading properly?
My ideas don't seem to work, can you tell me how to fix this @odd ember
I can't no
I don't know what error you're getting
ok, Thanks for what help you can give,
all I can tell you is what I see
ok, Can anyone else help.
Hmm, even trying this isn't seeming to work. Not sure what I'm doing wrong..
It's still going back to the same default rotation
Oh, there we go, that worked. Just had to handle it in the Level Blueprint instead.
Thanks for the help!
I just downloaded 4.27.2 through the Launcher.
I wanted to use Chaos.
Was that a mistake? Am I required to download and install from GIT?
How could i make a crosshair that moves with the mouse?
Like in top down shooters where you move the crosshair in the screen and shoot from there
So I need the GIT version?
Download the Chaos build instead.
But unless you're looking for something super specific from Chaos, PhysX will do just fine.
This is a screenshot from the launcher directly
I'm not really looking for anything special
Make a custom cursor.
You can set it in Project Settings on what widget to treat as cursor.
Thanks. I see it now. Stupid me, wasted time on downloading, installing and verify of version without it.
Then normal build with PhysX should do anyway.
Thanks ๐
Chaos in UE4 is not in a stable state and far more complicated to setup (and not having good performance compared to PhysX)
Okay. It's because I can't make the normal Destruction not fracture objects before I tell it to be destructible.
Like if I want a box to be solid until a certain event is done.
I fixed this by replacing a solid mesh with a destructible mesh, but it can't be true that it's the way it should be done.
Well, I got 4.27.2 now. So it's not complete loss ๐ I had 4.26.2 before.
You did it by having the object waiting for impulse strong enough (On Hit event) before you swap it with destructible counterpart and apply the impulse.
That's what even AAA games do.
Okay, so it's actually the right way I use, that I swap it for a destructible.,
And from my testings, PhysX destruction isn't like destroying the mesh all at once, so I don't think the swapping is necessary for larger meshes like buildings
It is an option for smaller objects tho.
I have actors that only thrown objects should destroy. That's why I was doing the swap mesh with destructible mesh on hit by throw actor
Is there a way i can add mod support to my game and add custom assets???
There is a way, but BP alone isn't enough to provide that.
The most proper way is to modify the engine (involving C++) and provide dumbed down version of UE4 Editor distributed through Epic.
Hmmmm ok, so lets say i want to add a .wav file in a folder is there a way it can read it and put into a dynamic array and adds it on there. And read the file??
Hey all, I was wondering how you all tackle the order of execution when it comes to bindings...
I often have a function off of BeginPlay which sets up some refences to classes I will need to use a lot, if it was the GameMode I may have the PlayerController referenced for etc. In addition to this, I'd have a following function which does the bindings for events.
The problem I run into, time and time again, is the order in which objects are created, and depending how you launch the game, viewport, standalone, build, it varies.
What I would really like is a process that I can use which says "all the important stuff is setup, its safe to do the bindings now" (or any other initialisation that I want to do that relies on various things being set up. Of course, if I use the GameInstance, I can't connect to some of these objects with a bind because they won't exist at the very begining. So my problem is effectively handling late binds.
One method that seems to work - WHICH I HATE - is throwing in a Delay node for 0.2 seconds... invariably everything seems to be created by the time thats happened, and then it all just magically works, but I HATE this so much, as its just a bit of an artbitrary value that whilst it may work on my laptop, might not work for someone else's set up...
So... what is it that I'm doing wrong? Is it my approach? Is there a better way? I tend to use the event driven route via dispatchers quite a bit, so would really like to find a good way to just make this work every time... I'm learning towards the GameInstance effectively waiting until everything reports that its setup... there's a HasBegunPlay node which looks like it might support this, but I would really like to know what you all do...
Hi, i want to be able to invert a N-dimensional matrix (and just access N-dimensional matrix math) but i'm only seeing 4D matrix operations in blueprints. Are there ways to get N-dimensional matrix math? Or is this only available in c++/not at all?
You still haven't answered me ๐
HELP. I deleted a macrolibrary I didn't need anymore and a few minutes later I played my game and i got an error. Now I see that for some reason my character movement in my player and enemies are gone!!
What do I do?
It doesn't seem like I can just add character movement component back
is there a node which ignores/doesnt have the opacity of the color and opacity node?
@maiden wadi so I think my issues is more to do with the logic in the Widget (first picture is the Color logic for the widget and the second one is getting the text for the widget. Seems to be returning to all of that class and im wondering how I can get the value for the individual actor and not show for everything of that class. When I stand over one item and then another it will only show the name and color for the first item (if im over multiple) Interesting stuff
ik ur answering like 40 questions atm lol sorry
really depends on use cases but generally if you want to prevent race conditions, make assertions of spawn order that you can account for
e.g. if one actor spawns another actor, you can assert that the parent will spawn before the child
could you check if X exists befor spawning the dependency in some way
you would have to poll continuously for it
so every frame you'd have to check
oof
if you just check once it's useless
I tried
@odd ember if you have a second could you take a stab at my recent question also
I don't when people ping me generally
This can get tedious after a while. The problem with answering this question is that it depends on a case to case basis. Most of it just comes from knowing the framework and how you build your own on top of it. If you want a truly easy way to handle manager classes amond each other at initial beginplay, use casts and a registration system somewhere like your GameInstance or a base GameState class. Have objects fire off and send themselves to the system when they're ready for play as a base uobject pointer. Your objects that need bindings can bind to these classes. GameIntance always exists, and GameState has to exist for Beginplay to be called so they're always available for binding. So if your classes that need to bind to other major things register with this, and then call their own check to see if what they need exists, if no, they wait for the binding to run, cast each object to the pointer type they need, if it's the correct one, it is the object you're looking for. This of course only works with framework classes, won't work with things that there can be multiples of. But usually those things are wrapped in their own managers anyhow. But like I said, there is no one solution for all. Stack your bricks and try to keep them somewhat in order as you do.
I seem to have a problem. I deleted a macroLibrary I didn't need and I realized a few minutes later it somehow deleted my character movement components in my player and enemy blueprints. I don't know how that is possible but now I don't know what to do. I don't seem to have a recent backup of those blueprint. Is my only option to copy and paste all the nodes, variables, functions, macros etc to a new player blueprint?
so i made this, and now on true i want to move the character to a location. How do i do that?
you really want source control for those kinds of situations
move to location isnt working.
Wait, your issue here is that only one of them is showing, not all that you're standing over. Am I following that correctly?
Also. Your first two image's cast nodes are bugging me. ๐ You're calling actor level functions off of a cast that will always succeed. Makes the casts pointless.
No. If it bothers you that much, make your own function in a BP Library or something that takes the widget type and just doesn't set the opacity to anything but 1.
Clyde doesn't seem to like you. ๐
ahh true i forgot about that, im not very confident in custom function but thats a direction
i found also render opacity which the node doesnt set so could use this, the problem is always not to know which way is best, since UE loves to crash so much, thanks
Depends on your case. Render Opacity is probably easier for most widgets. Color only works on stuff like Borders, Images, Text, etc.
Okay then ill use this instead for now, thanks for the advice
i made this function but isnt working, can someone help me?
So When I overlap with 1 weapon everything show correctly, If I lap with a weapon and then overlap with another At the same time The Text color and name of the first weapon also shows for the other actor im colliding with
and then if I walk away from both and go to the second
the second weapon displays properly
Are these all in the weapon?
and this creates a problem with Im holding a weapon. All the weapons I walk over have the weapon im holdings name and color
Yes
My coworker just said I should be getting these values form the local weapon stuct its self and not a database look up
Then you need to ditch the idea of getting it from the character. Your weapon knows what it is itself. The only thing it should need to know about the character is whether or not the character is overlapping it.
Database lookup is fine. But your weapon class would need it's own FName set for that weapon type to look up in.
I love over engineering the hell out of things
The widget is in the widget component?
Weapon's beginplay needs to pass the weapon's self pointer to the widget. GetWidgetComponent->GetUserWidgetObject->CastToWidgetClass-> InitializeWithWeapon(Self)
sorry work picked up so I might be confusing
omg, you should do a select on integer for the colour
rather than a switch
oof
Shouldn't do either. Maps are king.
No, you should do a for loop that checks if each one is true, then do a switch statement. You know, just because.
Personally I'd probably have a data asset with those colors as a map. No need to store that as extra data on the weapon itself. DataAsset can just have a function on it. GetRarityColor(RarityValue)
Be all Yandere style
Is it bad if an Actor calls Destroy on itself?
DataAsset can be stored as a pointer on the weapon. Much cheaper than a bunch of colors.
Does anyone know what I can do. My unreal engine 4.27 keeps crashing now every time I click on maps and modes in Project settings. As soon as I click the button. I've tried several times.
Don't know if this is the right place to post this
Hi Authaer, not sure if you mean tedious answering these kind of questions, or the actual problem - maybe both ๐
Thank you for the reply. I was trying to think of a way similar to that which you described. I approached it from a very simplistic fashion initially just to see if it might work. 4 booleans on the GameInstance, one for the GameMode, PlayerController, PlayerCharacter, and GameState. The idea was that after BeginPlay on each of these classes they would communicate with the GameInstance to say "I'm ready"... once all of the booleans were True, all of those objects would be effectively ready and I could then potentially use an event dispatcher on the GameInstance to say "Ok, Lets Go!" - each of these would then receive that, and do their initialisation...
...what made it feel icky was that I would have liked to have used the event dispatchers in the other direction also... e.g. have the GameIntance bind to the GameMode's "Instantiated" event dispatcher.. but because there's a good change it won't exist when it tries to do this, it just errors... which means the only other way I can really do it is to expose a function on GameInstance which each of these objects then call... wasn't really how I wanted to do it... would rather those objects just said "I'm ready" and anything that was interested can register its interest so to speak.
Any thoughts on the above, or, in the approach you were suggesting, do you have any form of really simple example you might be able to share?
I go around and around in circles with this stuff, what I would give for a class diagram that visually showed the execution of everything... sniff
I mean I did give you an example if you look up
Sorry only just jumped back on and missed your replies - my apologies.
The problem with what you've said, in my scenario, is that I don't get to control the spawning of GameInstance, GameMode, PlayerController, or GameState... they are all being created by the engine...
If you're using a ratio, then it won't work with the timer code I gave you. What I gave you is expecting to tick on real-time seconds and it determines what the in-game time is based on number of real-time seconds elapsed.
Here's one that works for using a ratio so that the ticks of the timer correlate to your in-game minutes.
https://blueprintue.com/blueprint/oyj161b0/
The calculation for the timer values is based on the the number of real-time seconds / number of game minutes in that time period (so for day time it would be 600 / 1020 (which is 11PM[1380] - 6AM[360])) == 0.588....
All that said, it will eventually fall out of sync with real time if you do it this way as you're dealing with fractions of seconds ticking.
I've tested this code, and it works without issue - as expected, when 10 minutes elapses, it's 11PM, and after another 5 minutes it was back at 6AM. The image here is to show you how to format the Game Minutes Passed into a 24HR time format.
You can generally reliably know that each object is created before another in the case of the default framework. For instance. No beginplay can run without GameState. GameState is spawned by GameMode. GameMode is spawned by the persistent world and that is created long after GameInstance.
By you hardcoded the value for the day and the night and those are ratios too, so why mine is out of sync and you're isn't ? ๐ค
Ironically, one of the issues I'm having is that I'm trying to reference the GameState from within GameMode after BeginPlay...
and its coming back as null
As for a better example. I'm unsure. I don't have much framework that requires other stuff. Most of my managers are actor components on major actors like HUD for local managers, GameState for game wide managers. I largely ignore the player controller in most cases. PlayerStates are somewhat of a pain in blueprint only, but are easy if you override a C++ function in GameStateBase and add a delegate call. Pawn ui and such is retrieved through their PlayerStates in a lot of cases.
you can in fact control the spawning of player controller from game mode, and the subsequent player pawn spawn. other than that you can create your own classes to spawn the order that you want
Er. I'm not sure that's actually possible. O.o
Are you sure a cast or something isn't failing?
I've just checked and it would seem that the cast was failing, because, being an utter numpty, I hadn't specified "my" BP_GameState in the GameMode class defaults... (its been a very long day)...
I'll rewind all of the changes I've just tried and see if I can get it to work... just really wondered if there was a "best approach" kinda thing to this... I fully appreciate that there's so much flexibility with UE4 to make stuff work in all manner of cases, but that very same flexibility seems to cause me no end of problems. Which leads me to feel that I'm a fekking eejit and have no idea what I'm doing... ๐ฆ
๐ Yeah, basically what happens is that GameState has a function that gets called on it by the GameMode. This sets a replicated bool and then calls the function locally. After that two functions are called. The first iterates over every actor currently in the current UWorld and calls Beginplay on it. Then it sets a state in the UWorld that it's BeganPlay. After that any Actor that is spawned, sees that World has beganplay, and calls the event directly after spawning it. Because of this you can always know for sure that GameState exists at beginplay.
It's probably in the math. What are you using for your ratios?
What is a map / dict called in unreal
Map in blueprint. TMap in code.
Is there a way to use a math function to create a curve in a curve asset?
Start Night Time = 23
Start Day Time = 6
Day Duration = 10 (IRL minutes)
Night Duration = 5 (IRL minutes)
how tf are you still stuck on this?
it's been 2 weeks now?
also your ratio calculation looks way too complicated
depending on whatever those ratios should represent
you can, to some extend, use math expressions when entering values for a curve point
not sure if there's any builtin method to create a whole curve based on it, but is the curve even necessary if you use a math expression for all values anyways?
Ok, those calculations should work with those values. You'll get the same values I had hardcoded. Are you setting the timers correctly?
Do you know of any way to view multiple Curve assets on the same window?
no, that's something that also bothered me a while back
Ahh bummer
Here are all the functions to calculate days, hours and minutes + my code for the timer https://blueprintue.com/blueprint/kap4vkxz/
For some reason, on my server TxtLog isn't being called as valid, despite doing a check on both ends
i'm doing a two player game, with a function call to print text on both screens depending on whatever was committed in the text field
Is that in a widget?
yeah, i added this check since i was getting the error accessed none trying to read property txtlog
oh, interesting
So you gotta set the text from somewhere else in that case
Hey guys, any advice on how can I make the item that I place to have the right orientation towards the wall its placed for example?
I have this and its working very well, but I need to do some more calculations that I cannot figure
https://blueprintue.com/blueprint/yzx2tvhm/
For some reason its working only for the one direction ๐
trace a line, get the hit normal, use that?
I am using the direction now, should I use the hit normal or impact normal?
try both
Its going underground for some reason :/ It disappears
HitNormal and ImpactNormal are the same thing in a line trace. They only differ in shape traces.
Using them instead of getting the location makes my detached item disappears for some reason
Now is one idea better, but the torch is pointing straight up
Instead of 25 on X for example
Looks like you're not calling your "Calculate Ratios" function before starting your timers... You're probably using whatever default values are in those variables.
Is there any smart way of doing a check if the item is going to detach against the wall to use that 25 rotation on the X axis, and if its going down on the ground then I dont care
for the rotation
I do that in the construction script
I am confused
I get the impact normal and RotationFromXVector to the transsform rotation of the SetActorTransform
Its very close to my end goal, but cannot clamp directly the rotationFromXVector
Not to interrupt, but I can have two separate instances of a widget, can I pass the same value into both of them using an RPC call in blueprint? I'm basically just trying to send a message through both, I already have the implementation, I've turned off the replication on my reference to my blueprint class
Well, if you're sure that's firing, then it's probably because every time the counters tick you're calling StartTimer which resets the timer, which may mess with the counting ....But to be honest, I don't know.
Why would it reset the timer ?
@maiden wadi do you mean something like this?
No. You need to select between two different rotations. Either the one that is the hit normal, or the one that is slightly offset.
So would casting to the data asset to get the map be stupid or is that how you would do it
How? Should I use select?
No need to cast to it. Just put a pointer in your weapon class. DataAssets are static. You can use them just like a StaticMesh or Material. They're not instanced.
Authaer could you check the screenshots above please ? ๐
I know what you mean by A pointer in code but not in unreal
That or a function. Getting your rotators is going to be semi difficult depending on what you need. If your torch already stands up straight when it's at 0,0,0 rotation, it's a little easier.
also can we clone Authaer, to many questions not enough time lmao
I don't care for the torch if its on ground. It may be rotated however its easier. I need to set the offset if Its touching an object
Is it on it's side or standing up in the static mesh viewer?
standing in the viewport of the bp
Hmm. You might be able to simply get the RotationXVector from the normal, break it add 25 to pitch and remake it with that and then use that for the rotation.
Er. Remove 25 pitch even. Adding would put it the wrong way.
So get rot from x -> break rot into axes -> X - 25 X -> make rot from X -> plug to new transform rotation
Im curious, is there any way to make having the blueprint editor open not slow down game fps?
even if you have a big graph open?
Run in Standalone.
This is exactly what I was looking. Just now when I drop the torch on ground it is going slightly underground. Is there any fix for that?
aw, there aint some freeze-bp-editor checkbox I can run? lol
Try this.
Not as far as I'm aware. I've never noticed it being that bad though even at work which has some crazy maps. Editor doesn't usually do much. Only time it should be an issue is for profiling, and you should be doing that in packaged games anyhow.
Sorry for the 400th question but how do I get a pointer to a DataAsset, and also is this what you mean by data asset
Oh, right. Uh. Yes, and no. Now you have to create the actual asset. That's the class for it.
Working like charm!
You should be able to create a new Asset out of that class you have there. Then in your weapon you can create a pointer of the class type, compile the blueprint, and then set it to the new asset version.
You can add properties to the class, and set their defaults in the asset. You can also add functions to the class, and call them on the pointer you specify the asset instance in.
I already deleted the asset blueprint thing
oh
So you need to make a bluepritnt of a type of data assets?
and then select it for the data asset
Yep.
My brains gonna pop ๐
๐ Welcome to data management 101.
I gotta say having a CS degree helps alot with this
I would have zero clue if I didnt understand how code works
I wish I had one. Would probably help. It takes me some time usually to catch on to specific words or phrases when reading tech blogs and such. ๐
You dont need one at all
but it made since for me to go to school
anyways
@maiden wadi so make the logic in the blueprint asset and then make the acutall asset form the blueprint
progress is happening
finally
Yep. You create properties and code in the blueprint, and then you can open and set those defaults in the pink/purple asset version.
Every time the timer ticks, it's going to reset the timer.
Yeah but the counting timer is my variable "Timer" which keeps the old value before the reset, so I don't see why it's a problem
I'm just pointing out that you have a timer that is intended to loop, but you restart it every time it ticks, thus it's not really looping. There may be something happening where unreal doesn't start the timer again until the next frame, in which case you're potentially not getting enough time actually set into the timer variable as the timer tick is not firing as much as you're expecting it should.. If you just let the timer loop as it's supposed to without restarting it, then unreal can handle the number of time's it's supposed to execute each frame without issue. This is only a guess. I literally have no idea further as to why your timers may be going out of sync, but this looks like something that potentially could cause it.
Yeah, map lookup is incredibly fast. And also you get to specify it in one place. Saves memory. ๐ Not so bad on small stuff like this, but it all adds up. But now you have a global easy way to access your weapon rarity colors from anywhere you need. Anything from a visual glow affect, or widget can access this data with ease.
Oh interesting, how could I solve that please ? ๐
Don't call Start Timer on tick of your timers.
Is there any sort of Begin Play on Init function/event for pure Object classes?
I'm not using the Tick() function
Or a Constructor to use for them?
They should be initialized by their owner.
Never mentioned the tick function.... it's the tick of your timers... your timer event.
IE, if their owner is an actor, have it route it's own beginplay to these objects, or call a function on them from their owner when creating them.
But when the night starts I need use the Night Ratio that's why I need to call it again ๐ค Is there another way to do that ?
Don't call the night function in such a way.
How should I call it then ?
Did you even look at the example code I gave oyu?
So for context; I'm making a faction manager. Figured that wouldn't need any sort of in-world presence and its being created in the Level Blueprint (probably a better place for it tbh).
Suppose I could just set all the faction relationships in the level blueprint actually.
yeah but you hardcoded the Time value in the "Set Timer By Event" can I use the ratio function I created to do that ?
As in a single object that maintains all factions data? if so I'd consider something like an ActorComponent on GameState
That might be a good shout, though could I not use the Object on GameState too?
Is there any real difference in that choice?
Of course you can use your calculated ratios... we even came up with the same values. If anything needs to change it's just the branches that check the amount of minutes passed would need some input values if you want to keep along with being able to dynamically set the times (needs to be in game minutes).
Sure, you can. And not much. Components are cheap. And you get easy access to beginplay, and tick, and world. Much easier to access things from without C++.
Not hugely worried about having to use C++, I'm making a prototype for now but will likely start using C++ if I'm pleased with the final state of the prototype and want to move forward with the project.
But yeah, component sounds like it may be a better shout just for that beginplay. Tick not so useful here.
I know you have the extra checks on your timers too (like your minigame time), that can be an added event call on both the timer ticks by adding this event and calls to it.
do I bring the asset in as a variable, ive looked around and dont see how that works
I do have these set up, the data from the blueprint does show in the asset
Then you can use the pointer to access your function you made.
They're static, globally accessible. So there's no need to "Spawn" or "Create" an instance to set into the pointer, you can specify it just like you do a mesh or material.
Dude I was really trying to call that name instead of my asset name
I think I need a brain break
๐ ๐
is there a way to avoid input variable connection spaghetti in Macros?
input variable connection spaghetti..?
Thank you!
all those lines going out from input variables
when referencing in multiple places
you can just add additional gets :)
that's cheating, I'll report you to the blueprint authority

good thing I have an official Tim Sweeney Get Out Blueprint Hell card
I don't believe we can do that in macrolib
Ah, yeah it only works on functions
yes
Not much else you can do then than try to arrange the lines so it doesn't get too confusing
I've mostly just made functions, I haven't found macros so useful
is there a way to attach a secondary collision component to a character that blocks movements for others?
Preferably one that I can rotate
Sure, just attach another collider to it
did you change its collision profile?
fairly sure if you set it to physics and block the correct channel it should block then ๐ค
What Event should I call first to launch the timer ?
If I spawn an actor from a class soft reference of a blueprint, it will crash unless I've previously opened that blueprint in the editor or have an instance of the blueprint already in the level. So it seems like when there's just a class soft reference to something, Unreal will not bother loading it into memory or something, so it doesn't know how to create it. Does anybody know how I can specify a list of blueprints to make sure are loaded into memory when the game/editor start?
ahhh neat, I'll give that a try
there's also an async counterpart https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Utilities/AsyncLoadAsset/
which you can use if you don't need the result at the current tick
sounds good, thanks!
@wispy fiber just checked and for classes there seems to be a separate node
load class asset blocking (which also does the cast for you)
it doesn't seem to do the cast, but it does work
ok, i'm on 5.0 maybe that changed there
ah, I'm on 4.26
hmm I wonder what happens when you load an asset on the client and then pass the resolved class reference to the server via replicated rpc and try to spawn the asset
probably bad things
no idea, also not sure if it's advised to replicate class/object references at all
yeah that's probably a good point too. I know object references are supposed to work, but class reference seems weird (although it does appear to work)
now i wonder why the async asset loading methods wont show up in my editor -.- nvm they only work in event graph
if I load an asset on the server and then spawn it (assuming it's a replicated actor), I wonder if the client will automatically load it aswell or if it'll crash
Depends on what time of day you want the timer to start on. Day Time? StartDayTime. Night Time? StartNightTime