#blueprint
402296 messages ยท Page 545 of 403
how do i control which pawns spawn for each specific player start?
override HandleStartingNewPlayer in GameMode, do not call the Parent, and spawn them mannually
How can I optimize this?
Hello there , can anyone help me with something on world composition? I want to have a smaller part of a sublevel to be visible in certain area , i thought about using level streaming volumes but i don't think i can since i'm using world composition , do you guys have any ideas i can use to solve this?
@twilit heath so i spawn the actors by class... now what? they need spawn transforms and i need to possess them
you want different class Pawns for different PlayerStarts
that is not out of the Box functionality
so you need to stop unreal from spawning the default pawn
and do everything else by hand
yeah i have default pawn set to None
but i dont know how to wire my players to these pawns that i'm spawning manually
one of the simpler ways is to derive a class from the PlayerStart, put in a Class variable for the Pawn it spawns, then Cast the ChoosePlayerStart result and pull it out for the SpawnActor
PlayerControllers also cache their StartSpot by default, and ChoosePlayerStart returns the cached one by default, instead of making another search
so you can assign the classes from an array on the fly, depending on what you want to do
ok trying some stuff
thanks
sorry @twilit heath i guess i'm still not understanding how all this ties together
i've created a custom PlayerStart with MyPlayerCharacter class stored as a variable
i override BeginPlay and spawn my actor
oh, that just creates 2 copies
yeah no idea
@late marsh https://youtu.be/Mxw391exhVg
Need a special kind of loop? Perhaps one with a delay? In this video we show how to use the Standard Macros Library to add your own customized loop type. WARNING: Modify the assets of your Engine folder at your own risk!
A link to the wiki for further notes is available here ...
I came across this tutorial that adds delays to loops thought you might want to take a look
ty i shall have a look
surely UE4 has a built in Look ahead Camera system for 2D games like Unity has ?>
this dude goes on to using 14 Branches to acieve a look ahead system that unity has built it?
Ue4 doesn't specialize in 2d
Like at all
It sucks
But you can attaxh a spring arm and add offset so where ever the character is looking the offset makes the camera drag towards that side
Ya I was thinking of doing that, but I'd be cool if it can transition smoothly to the offsett
like when the D key is pushed and the character starts it's motion animation have the offset add up to the total smoothly
You could do that fairly easily by interpolating the camera position
eg. you have a "camera target" which is by default locked to the character, and it keeps interpolating itself to the camera target
when you start moving, you then move the camera target to where you want the camera focus to be, and since the camera is constantly interpolating its position to the target, it would then smoothly move to the new position
Okay. That sound fairly simple, but for someone currently learning blueprints that seems super complicated to achieve. Can you drop a link or nudge me in the right direction please. @rough wing you can't go in the negative with the camera lag. so the lag is always behind you and not infront of you
this is my player bp every time i open it my pc has a stroke
doesn't seem too bad, you could probably organize it a bit more cleanly with maybe some comment boxes around individual groups to make it easier to navigate too :D
Yeah comment boxes is really the only problem I see, you could also use some reroute nodes to orginize the lining a bit better
this is the ai i made idk how but it took me like 3 times longer
anyone got any useful info about making a mystery dungeon type game in blueprints?, not having much luck with googling
you'll have to be more specific than that
I for example have absolutely no idea what is a "mystery dungeon" game :D
yeah i was thinking that same thing
lol same here
It's a mystery
Pretty sure they just mean randomized dungeons.
how to get player controller in multiplayer?
it reutrn at 0 index, but i want to get player controller for clients
@gritty elm That highly depends on which machine you run the function on.
On the server, player controller 0 is the first connected. In a client, it's the client's controller.
sorry, a Mystery Dungeon game is a dungeon crawler thats sort of turn based, movement takes a turn, attacking takes a turn etc
usually procedural maps hence the mystery part
how i get reference to player controller for client
@maiden wadi
how i set show mouse cursor in client?
@jade gull first step is to make your game play on a static level you use for testsing and stuff, and then make the dynamic levels.
If the dynamic level is specifically what you are asking about then do a google search on the "carving out" method used to make random dungeon map
maps*
i have so far made a procedural tile floor and a character that moves 1 tile at a time but is loopable
Thats a pretty solid start. I highly reccomend not developing on a dynamic map though.
am mid watching an old unreal livestream about procedural generation that im hoping would shed some light on adding the walls etc
i'm not really sure how to go about the turn based thing either =/
You can toggle whether the player can interact with their characters based on a boolean
So when the player ends their turn, you toggle the boolean to false, and then perform any actions that need to happen
Once it's the player's turn again, you toggle the boolean back to true
You might want to use an int instead of boolean though, if others needs to know who is currently playing
what i have in mind is an actor for managing turns that interacts with a master "Things that can take Turns" blueprint, since its more of a single player thing the turns will fluctuate dependant on stats etc
Use both an int and a boolean if in multiplayer
one for PlayersTurnId and IsMyTurn
even if the PlayersTurnId is the players id and the IsMyTurn is turn, thats ok, the flexibility of using both out weights the small amount of redudantness
@gusty stump what do you gain from having a bool with an int and not just an int?
you could quite easily just make a function to check it so you wouldn't need a bool :)
You want both because you use a int to tell when its anyone elses turn and the bool to tell when its your turn. In single player game you could most likely ditch the bool, but in a multiplayer game you let the server have control over the int and the client have control over the bool flag and only if both match up do you let the player take a turn.
in a single player game you might want ot use a bool so that you could allow a player to interject a turn into a place because of game mechanics
I mean you could just check if turnInt == myPlayerId
client shouldn't ever control decisions, just the servers. so no reason for the bool
so the bool is very redundant
say its suppose to be orc orc player in the turn order but player has the butt in ability and so he butts in after orc 1s turn and gets to set his my turn flag turn but maybe not advance the index variable
Sure guys go ahead and feel the way you want.
that is an interesting idea
I mean you can always find features that would necessite additional variables to be used :)
so even though it hasnt reached his index it would still get a turn early cause the bool etc
well since I am a proffessional coder who works with designers on a daily basis i tend to opt to flexibility instead of having to rewrite my code every day when someone thinks of some kew new idea if we could only do this
and two years down the l ine when you think of a kewl new idea if only you would have used both a bool and an int
i get stuck thinking too much ahead and dont have enough experience to actually make half of it xD
@gusty stump I'm not sure I fully understood your example, but I still wouldn't use a bool, and client still shouldn't control it.
Client should send the sever "activate but in ability", and server will set next turn to him. server also needs to remember who's next turn is it after (I believe that's your point), but still no need for a bool here
If you try to predict every new feature you might think of down the line you're going to write very complicated features "just in case"
@haughty ember dude you will have tons of variables that are in the client that are set off of server authed variables because of gui and tons of other stuff
@jade gull focus on what's immediately in front of you :)
I mean i am currently making a multiplayer game
and have developed tons of game systems
and can tell you that you really dont have an idea of how stuff works on a client
yea if i succeed with this game it would be my first xD
@haughty ember dude you will have tons of variables that are in the client that are set off of server authed variables because of gui and tons of other stuff
@gusty stump That's no reason to add unnecessary variables ..
Sure dude
anyway im gonna get back to my game
if you bro and broettes need help feel free to dm me
Have fun, thanks Trixer o/
o7
Hey guys! Any chance anyone knows how to "PauseAnims" in the character blueprint, but still keep gravity enabled for that player? When Pause Anims is enabled, the player is paused, which i want, but they are floating, or won't move with an elevator, etc...
I'm trying the Asset Registry to find CameraShake by class and its not showing? Anyone know if it might go under a different name?
Update: Its marked as a blueprint
To replace the Event AnyDamage to a custom one, is this what it should look like?
https://gyazo.com/8dd43fe5aac56e83bac3f1ba9f3ecba2
It shouldn't be an RPC
rpc?
ExecuteOnServer RPC
I just put not replicated? instead of Run on server?
(a little edit, I'm doing a multiplayer game)
Do you want clients to freely damage everyone that can get a hold of? No you don't. So yeah, just a normal event.
You should mostly only forward input events, like "Fire my Weapon" to the Server.
Then the Server can do all the rest up until the damaging.
I see, thanks for the input. Good to know
how do you add a timeline component to an actor? I can't seem to create one.
just add timeline, and the name of your timeline is the actual your timeline component, if you right click after adding time and search for your timeline, you will get your timeline component ref
aha, cheers
what is a spline time?
no, on a spline
is it zero to one? or zero to the number of points? or is there some non-obvious way to set a duration?
Is someone avilable to help me with some problem i'm having? i'm trying for 4 days to fix it
just ask dude
i have the full details over here:
https://www.reddit.com/r/unrealengine/comments/j948kv/multiplayer_advanced_sessions_session_joined/
1 vote and 4 comments so far on Reddit
what is a spline time?
@vestal plinth btw,Given a time from 0 to the spline duration, return the point in space where this puts you
there's no way to set a spline duration
it's zero to one btw
oh shit wait
it's in the details
you can't access it from blueprint though
and nevermind, now you can
mystery
cool
I've been trying to make a multiplayer spawning system, but when I run it, only one player is able to control their pawn. Additionally, for the rest of the players, their view is of somewhere completely different than the spawn location, but the actual pawn is spawned in the right locations. Here is the blueprint function: https://blueprintue.com/blueprint/f01eupz_/
If you have any resources that may help with my issue or any ideas on the cause, let me know.
nobody reads the docs man
yeah usually I look at the source, but my IDE is closed
๐
hmm
so my problem is, when I set the timeline duration to match the path length, all it does is make the timeline longer. that last point in the curve still stays at 1.0
so I tried using GetPlaybackPosition to just get the time elapsed and use that like a linear curve
it still behaves the same though
the debug dot traces the path for a second to the second point then vanishes and doesn't complete the spline
actually, it always runs for a second. it doesn't reach the second point.
I guess setting the timeline length isn't working
ok, worked it out. the actual curve stopped existing after the last point so the timeline stopped running, no matter what the length was. so I just made the curve a minute long and it uses whatever part of it that it needs.
it's still ignoring SetTimelineLength and trying to run for the full duration of the curve inside it
I can work around that
how do you guys handle banking with a spline mesh?
construction scripts don't act like I remember them doing in the past. if I edit a component's location or rotation directly on the actor it still uses the CDO value in the construction script, making them a bit useless as instance controls.
How can i make a movment blueprint for a blender model?
I cant make a blueprint on it.
@trim matrix make a new actor asset, add a static mesh component, and assign the blender mesh to that component in the properties window
Has anyone had an issue with a public struct on a BP actor not being modifiable on copies of that BP in the World Outliner view?
I added a new enum field to my struct and when I click the drop down to modify instances in the world, it won't accept the change (resets to default every time)
Actually, I even created a child instance and modified the struct fields on the BP itself, dragged it into the world, and it still wants to use the default value instead of my selected value.
@trim matrix it needs to be a skeletal mesh; is it?
@still bramble you have no font, so it defaults to a pink filler
@mortal nacelle no, but can you show how you modify it? is there a construction script in the actor?
ok thanks
@zealous moth ah yes, there is a construction script. i'm modifying something from the store, so yeah I didn't know to look there. thanks!
i have an instance of the actor in my level. then I click it on World Outliner => Details Panel => Find struct field, click enum field drop down and select a new value
it doesn't like this
@vestal plinth set timeline length is not what you thin it is imo; try using Lerp nodes instead?
@mortal nacelle can you show me a screenie?
of the struct and your actor
@zealous moth ok, cheers ๐
@mortal nacelle how are you modifying it in the construction script? My guess is you're accidentally setting everything else to default at the same time
you cannot set a hard-coded value already set in construction. construction overrides it unless there are specific fall back conditions
I'm just thinking they might not know about hiding pins on the Set members in struct node, and so might be setting the entire struct rather than just the value they're wanting to change
BP Actor w/ EquipmentSlot set to Weapon1
BP instance in world selected
So this is not even trying to modify the field in the editor. Just on a BP itself. You can see EquipmentSlot is None for the world instance of this
It probably is Construction script related though. Because once I play in PIE, I can modify the field as expected. Which, I'm guessing, does not execute construction scripts anymore.
I think I have two separate problems. (1) construction script or something is resetting my selections. (2) my new EquipmentSlot enum field is not populating when I instantiate an actor in the map editor by dragging it in
Sorry im very new, how do you create these variables,
Hey, i'm trying to solve a bug for 4 days:
https://www.reddit.com/r/gamedev/comments/j96mqj/help_session_joined_player_cant_move_only_host/
can someone help me?
0 votes and 4 comments so far on Reddit
@full locust that variable type is Vector 2D
And you can right click -> split struct for a lot of variable types like that one for instance to get the individual X and Y values
Ok thanks alot
Hmm, my construction scripts don't seem to touch the struct
ok, its definitely my construction script because if i disconnect everything from the starting pin, everything works as expected editor wise (changing fields, etc)
its kind of weird though, my construction script doesn't modify the struct. it just sets text on a widget...
Does it have a parent blueprint that could be modifying it in the construction script?
If one of these is part of the construction script, then chances are the struct is being modified in the parent class
You'd find the parent class in the top right of the editor. You can jump to it from there
For List View, how can I setup the height of my item widget ?
I tried to change the actual widget, but it keeps making it bigger than it should be
like I would like for each entry to be as small as that box on the side
There is a stat command for showing you what is currently loaded into memory, and how much memory is being used. anyone know those commands? I knew them, but now when I need them, I can't remember what they were. ๐
@flat raft stat fps stat unit stat rendering
and so forth
@frozen dune you can wrap it in a size box
Found it here... obj list
@zealous moth you mean put a size box in my entry widget ?
i think so :x
@marble tusk yes, I followed it to the parent (through like 3 layers of inheritance lol). seems to be something in the parent BP because that is the construction script I disabled to restore behavior in the editor, although nothing is setting any fields on the struct that i see so far...
oh, no , try in the actual list item
I did tried, but the list itself becomes small rather than each individual item
and the widget item I am using does have a static size
it does call the getter of that struct field, but thats about it. would that be enough somehow? no right? it should be setting somewhere if i am seeing it overwritten
ok, this is interesting. the base class function is overridden by an event on the eventgraph? this seems to be the issue
base class construction script
subclass has an Event Change Item that is causing the overwriting of fields:
why does Change Item (Target BP Base Item) actually call an event on the subclass first? is that because BP treats all function calls as events under the hood?
I would have expected InventoryItem to have an override method for ChangeItem() if this was a normal coding language
anyways, this is definitely where the original author was setting my struct. they take the ID and look it up in a data table and then reset it from that ๐คฆ
Greetings. Is it possible to make array of Foliage Types in HISM instead of Static meshes? (FT stores the materials too)
This is part of my code to fire a projectile. When I try and fire it though, nothing appears in the world. No actors, nothing. If I do wonky stuff with adding vectors, then the projectiles appear but it does not stay consistent with the player movement. How do I fix this?
the goal here is to spawn the projectile at the center of the screen instead of at the barrel of the gun btw
changing the collision override to always ignore does not fix the problem
try disabling the collision on the model for your projectile and see if that helps
Hey guys! Any chance anyone knows how to "PauseAnims" in the character blueprint, but still keep gravity enabled for that player? When Pause Anims is enabled, the player is paused, which i want, but they are floating, or won't move with an elevator, etc...
is there a way to get a camera to ensure it always has 2 objects in its view no matter the distance?
@chilly jetty you mean like zooming back and forth like a fighting game depending on the distance they are appart ?
yeah
or like in DMC5
when you lock onto a target and no matter how far away you are you both are in view
hmm im thinking about it
I've done that
Get all characters you want to include in the view
Add locations
Divide by number of actors
Set camera loc
Or something like that I can't remember much on top of my head
@chilly jetty
will try that
Oh wait I just remembered some more
I think I was only getting the largest and smallest amounts of x y and z
and then dividing and setting
hope you can figure it out mono bc i have only a clue yet but no solution.
i dont know if there is a way to use the "Get Distance To" node and the "Get delta World Seconds" node to get the float distance to the other actor and compare it with a greater than or less than value to another point in times distance; making the value an increase if there was a greater number than the other point in times value (get delta world seconds; subtract 0.1 to represent the past). Then vis-a-vis to store a variable decrease in distance to the other actor.
@chilly jetty @rough wing sorry if that doesnt make sense thats what i got to
i can try to explain it better if need be
that hypothetically would allow you to track the increasing and decreasing values of distance to each other at least
after that you can use that variable to manipulate the camera
I mean you dont need to track increasing and decreasing distance
you just get it and set camera location
you dont need to track anything else
how do you get it
the way i explained it
so they have a node for that is what you are saying
GetDistance
hmm ok thanks
btw i had a question about this blueprint when trying to get my character to align to the surface of faces of geometry while walking/running
the array that says world static
how do i get the world static option for my make array node
is there a way to get a range of static meshs for "adding static mesh component* to an actor by name?
like this but into an array:
or would it be better to just add all the static meshes to the actor and unhide them when needed?
For Loop?
How many SMs are you talking about?
but you wouldnt be able to pass any kinda name parameter to say which mesh you wanna pull
bout 70
possibly more later
Once the SM component is created you can also set its Mesh etc programmatically.
which is why i wanted some
oh tru
that might be better
then i can just make the name a public var
i think too non-procedurally sometimes
๐
thanks mang
NP
probably still need a for loop in my construct tho to pull all the names and make an arry tho
and im also an idiot
DONT SAY IT
i know what youre going to say
lol
All good ๐
Your going to tank your FPS calling that on tick lol
๐
Haha ok
All you would need to do now is just use a ForEach loop on that Array and set the mesh after creating the Component.
๐
only selects one mesh
Ah
we good ๐
No worries
Nice
yeah. eventually ill tie in a nice animation transition for that
just wanted to get the basic idea in first
Looks good.
oh one mroe dumb thing... does UE have some kinda math operand thats like an int count with a range / loop?
could use use a rand int too i guess for testing
just curious
Array->Length
lemme sketch it out
ah okay i see a problem here
keeps adding.
derp
guess just cast newmesh to a var
but yeah
Oh right, yeah you want to save the StaticMeshComponent to a variable, the next time you want to change its Mesh, just set a new one, dont recreate the Component.
yeah
yerp
This is probably what your looking for.
soory, just a question, are there advatages to say putting the 'make static mesh compenent' in the construction script vs. the event?
theres gunna be more stuff to do other than just make a component... so im just curious if i should be building things in construct
that just init things
If you do it in the construction script it will run everytime the Actor changes, even inside the Editor.
hm
So for example, if you were to drag around the Actor within the Scene, the construction script will run alot.
Yes, however the Editor is different.
i see
That is true for Runtime
Editortime is different
Running it in the construction script can cause you to easily tank your fps if your not careful.
right.
Especially when your programmatically creating Components
for safety ill just leave 'make' things in the begin play before any events.... then let the actual programmer sort out what goes where.
heh
For simple BP stuff, you can get away with ignoring the Construction Script
im more of just a generalist on the whole project.
idea is to just prototype things for the other team
Fair enough.
makes life easier when illustrating what you want vs trying to explain it
so ive noticed
alot of this will likely get nativized to C anyway... well .. the heavy dumb shit anyway
not my problem tho
That makes it easy then ๐
still good to learn
Anyone knopw why adding a sphere component that is just set to overlap dynamic, would cause a pawn to be unable to move
Guys, why UE4 stores savegame files in different locations if you package with "developement" and "shipping"?
Shipping also makes them available to clients very easy... so they can hack them
They can "hack" them anyway, doesn't matter where it saves them
Vehicle component doesnt have engine stats exposed with realtime editing why is this...?
Canโt I use delay in a BP-function?
no
if you have a delay in a function then it probably shouldnt be a function. you can use a macro, or if you are using a fucntion to collapse a bunch of nodes to make it look clean you can use the 'collapse nodes' right-click option to 'hide' a bunch of stuff in a small clean package
function is suppose to be calculate something and return it immediately - like get all actors called Robert and sort them by distance. no delay required etc#
Got it! Thank you ๐
Hey guys, I need to control several CAD objects via blueprint, so the client can have them fade in and out. Is this possible WITHOUT a material solution? The CAD objects are quite complex and consist of 20 materials each.
I have no experience in blueprints, so before I go on a google rampage, maybe you can tell me if its even possible...
gut instinct is it's not possible without a material - you can create a global material parameter collection to control multiple materials from a single value set in a blueprint though
have you tried a low cost solution like just scaling the objects down over a short time using atimeline or something - that would give you some form of animation so it doesnt looks too cheap etc
The client wants fade in...
Iยดll look up global material parameter collection and how to use them in blueprint then.
My colleague was suposed to take care of the blueprint part of things, but he is out sick...:(
maybe parameter collection would be a bit annoying as you would need individual parameters for each object - might not be easy to scale it up if you have dozens of objects.
Canยดt I use the same global material parameter collection for all materials that are referenced by all objects?
Fortunately all objects use the same set of material instances.
it might be easiest to create a material function that has some parameter like "Opacity" feed that into DitherAlphaTransparency - put that into every single material - you hopefully have a master material and use instances as that'd speed things up.
add the top stuff to construction script, and then trigger the fade in or out in the event graph
as long as each material has a paramater called Opacity it'd work, just have to set it up in materials
Yeah, all material instances of one master material. Except for one material, that is refractive, for that Iยดd have to have a different solution I guess.
Thanks for the suggestions, Iยดll look into it.
can still use the same setup, just need to have opacity parameter in the material - you could have the opacity parameter drive a lerp between full refraction and default refraction, would turn out alright
i'm getting a weird issue with the tile based movement i've made, it seems to ignore the delay for the first few seconds after the first movement button press and will zoom around instead of moving 1 tile at a time as intended, after a few seconds it does work as intended but i'm not sure whats causing it, any advice would be appreciated
thats all thats in there so dont know where its going wrong
also any advice on making the contents of that second image better, i know the way i've done it has issues so would like to improve it
Not sure about the delay, but you can treat the movement as two numbers instead of four bools
so X and Y, where 0 is no movement, and for example 1 is right, -1 is left for X
if you use that method you can then calculate a direction from the numbers, and choose the enum value based on that, which should mean you don't need that much branching
Hello.
I am new to UE4.
I have a question regarding "camera switch animation" using Blueprints.
Is this the right platform for that?
Anyone know why dynamically added meshes are stripped of their collisions?
1: inserted with "add static mesh component" in construction script 2: normal mesh
Alt+c is not showing collision and traces are not working
Could it be because my parent class is NavLinkProxy? How do I fix this? can it even be fixed or I've done goofed?
I'm getting an error that the variable "Dynamic Material Instance" accessed none trying to read the property. I did initialize the dynamic material instance.
I do change the element index and target mesh of said dynamic material instance later when the user presses a button. Does that somehow make the dynamic material instance invalid?
Hello!
I'm creating a mechanic where I need to check if the player is aiming at an object. It did that with a linetrace, it works perfectly but I want to allow that the player doesn't have to totally be aiming AT the object but also around it. I tried to use a sphere linetrace but the results are off. Does anyone already did something like this? What were your approach ?
Hello. idk how to create widget for one player on multiplayer. Help
do this
oh
why doesnt my method work
I want to understand so I can avoid making logical errors
couse you use character movement to target. you must use character controller for target
Hello. idk how to create widget for one player on multiplayer. Help
and how do I increase my character speed while pressing shift?
I cant find the set module
You need to set from character movement because this is from this component that you can find teh max walk speed
yeah but I cant find it
ok thanks
Hello guys! I want to create a touch event for a mobile game, to rotate an actor. My problem is that the touch is not getting any event only if I'm touching some text or border from the UMG. How can I make the touch to receive events from the entire viewport?
If I press on the 'Damage' text and start moving, the weapon rotates
If I press the crouch button nothing happens
check if you have crouch enabled in the character movement component
Did you checked CanCrouch?
oops x3
How can I make a slide? I already got the conditions part working but dunno how to do the rest
so far this is what I planned but dunno how to make the position relative to the camera
if you get the camera's forward vector, you can then multiply it by a float to generate force in that direction
hey how would I make a bus move in-game instead of the default player character?
the player is going to be stuck in the vehicle. it's not like an enter/exit thing
Hi All,
I am working on UI and about to create an ENUM with All UI commands in it.
Is there any reason to not have an enum with a few dozen items?
I was initially scared to start Unreal because of blueprints (I come from Unity's Visual script) but I just realized how easy and intuitive they are
Yes they are awesome. I have no coding background and I am astonishing myself all the time with what I can get done.
How do you change you default player pawn during runtime? I have code in the playercontroller that makes it a problem when I possess pawn. I need to change the default player pawn as well. Please @ me so I can see later thanks.
try level blueprint maybe?
@opal stone The default pawn is used when the game starts, it makes little sense to change it at runtime
Hi i dont know how to make "when player touch triggerbox then". I cant make begin overlap becouse i have this blueprint in Third Person Character and i can't do overlap.
3rd person characters can still use begin overlap
nope
@sharp fox you would have to do it in the blueprint the triggerbox exists in, if you just dragged it into viewport that would be level blueprint i think, then you can do the beginoverlap event, keep the box selected when you go into the blueprint then right click
im copied this from level blueprint and its this
Don't copy nodes from other blueprints
^
Are you able to make a var with type data table?
That's why it's not working
a data table is based on a struct so the struct as an array would count?
yeah was over thinking it lol
guys how can I make my katana animate when I press left click?
start with left mouse button, then depends how you've animated it
How do I animate stuff inside unreal?
if it just rotates or something you can do a timeline lerp
if its skeletal you'll need to learn animation
its a first person character, hands arent visible
so floating sword?
ye
a moment, trying to make an example
Someone help. I don't know how to add widget to only one player like health. Someone Help?
in character, Create widget, From reference, add to viewport
or add to hud then add hud in that way
yes but i have to do when player go over lap with actor then add to viewport
@crimson saffron thats a basic tmeline lerp you can use for simple rotation animations or change to location or transform for other types
within the timeline is just a float track that goes from 0 to 1 over 1 second to feed the alpha
but how can I animate it?
that changes its rotation over the time set
Unreal crashes when i try to select this node to delete it, so I can't delete it. Is there a solution?
Here is the error
@sterile light
- Your name makes me thirsty for tea.
- Are you able to delete the variable itself? Like not the node the whole variable (assuming it's not used much. If it's used anywhere else I'd create a new variable of the same type, run find in blueprints on that variable and replace all of them with your new variable (by clicking and dragging the new var from the left onto the set node. This might crash unreal when replacing the one shown in the screenshot, so I'd try replacing that one first to save time), and then finally delete the L Buff variable. (If you weren't able to replace the L Buff node in the screenshot bc it crashed, replace all the other ones and then delete the L Buff variable even though it'll whine that it's in use.
There is no variable. I've coppied that code from somewhere else so it makes sense it cant find the variable but I can't delete the set node
I've tried creating a variable with the same type and name but it doesn't register them as being the same
I guess because the previous var was a local var
MULTIPLYAER | I need to set a nickname on the Main Menu Level, and when i join a session I want the nickname on the Lobby Level will apear on the Text Render above each character.
Any solutions to achieve that?
Someone help. I don't know how to add widget to only one player like health.
@sterile light Have you tried both LBuff and L Buff (with a space)? Also trying the drag and drop to replace like I mentioned above isn't a bad idea
Yes tried both
@normal rampart I didn't really understand what you mean above
All I want is to obliterate that node. Isn't there a way to do that without selecting it?
Like delete nodes with error?
Is there an alternative to structs for data management (items, stats) that allows composition or inheritance?
Right now I'm storing every possible item type data struct in one big Item struct and it's getting spaghettier and spaghettier.
omg
Ideally I'd rather use inheritance so like base item, equipment extends item, weapon extends equipment etc
Someone help. I don't know how to add widget to only one player like health. But i must do it in level blueprint
I just dragged a variable onto that set node and it fixed it
That's what I was saying lol
Glad to hear you got it fixed. ๐
thanks for the help
Someone help. I don't know how to add widget to only one player like health. But i must do it in level blueprint
Is there a Cast To node that is dynamic?
Is there a way to set a UPROPERTY in my GameInstance from a widget blueprint?
I have an options menu but I'm wondering how to get the data out of it and into my C++ code ๐คช
@vast lion no, usage? sounds like you want a component/interface
@hidden hearth maybe i dont understand, but to set a uproperty in the game instance, just GetGameInstance > cast to your game instance > set property?
@supple dome Yeah you're probably right
How come this node only works once?
The second time I call it the Loaded array is empty
Why is this?
@supple dome thanks :)
https://gyazo.com/a9a2f882703ffa7ff951a050804f3558 Confused? I just duplicated one of the levels because i have like different nights and stuff.
the problem is your code has refrences to stuff in another map
@mortal wharf At first glance, that looks like it's saying that its level BP contains bad references, specifically refs to actors in the map from which it was duplicated. If that's the case, replace the refs
you need to go into the editor and change the references to ones on you rmap
so in my fps i have set up my rifle to attach to the right hand via a socket on begin play in my character. the arms are "static" and are just in one position, but will move for animations like reloading.
How would i go about making it so the arms would change if i were to say equip a pistol?
Anyone know how to check a level is valid prior to loading it?
Is there a smart way I can make this work in my Animation BP? Basically what I want to achieve is using a certain aim offset depending on if the player has a rifle or a pistol equipped, but if the player isn't in combat mode - use another (or no aim offset at all actually)...
So basically I want to switch between two different Aim Offsets but only if certain conditions are met... if none of them are met - don't use Aim Offset.. Can't really wrap my head around the nodes in the Animation BP, I'm kinda new to them still...
I've tried doing it like this instead, which works... kind of. It's jittery but it "works". How can I make the Aim Offset more smooth using this method?
So here's a tough one. I need help with some array work. Hopefully I dont Overcomplicate this. I want to create a crafting system in which you dont have a given recipe. I have 4 slots. each slot can have an item dropped in it from the inventory. I want to check these slots to search my data table of recipes and see if they match up, then it can output the item to craft.
Does this make sense?
I have the data table and a way to look through it. I have the crafting slot information array. Just need a way to search the data table for the exact items that are in the slots
@lone garnet use [for each] item in array of "items needed for crafting" [find] item inside of inventory array.
but i dont want to find the item in the inventory, I only want it to check the data table against what I've put in the slots. Some of these recipes have 1 item needed for crafting, some require 2-4.
how can i 'Find' against multiple items and not just 1 item
I haven't dealt much with maps. quick rundown?
a map is a "heres this key" give me information on it
heres this warrior. give me its health
and this can be used with a data table?
does the data table require one of the variables to be a map too?
no you would have to create the map
Im not sure why for each wouldnt work in your case
with just basic arrays
I think the problem is that it cant narrow down the data. Like I can foreach the crafting slot items, then check if it is contained in the data table. This way it inputs possible recipes, but once I add another item into another crafting slot to narrow down the recipe, it treats it as if thats the item to lookup and not both
so I need it to lookup the items in the data table that have all of the items in the crafting slots and not one or the other
Here is something I just tried Which is close
But I cant be dealing with 'Identical' Because then it requires the items to be in order
is there something I can use as an 'almost identical'?
like contains but I dont want a contains Item, I need a contains Array kind of thing...
@lone garnet have you tried using the "and" node and multiple contains if its more than one item?
then only return those that match both 1 and 2 (and 3 and 4) as needed
@jade gull If I have multiple contains, I would have to have one for every outcome of recipe combinations i think
yea would need one at end of each branch 4 total but just need a variable that says how many filled slots to guide the branches
or selects if you can use them well but i dont know if they are more costly or anything vs branches
I have a check which already tells me that there is an item in specific slots. Is the contains necessary if I have that really?
Hey everyone, I am trying to get the triangle/polygon I am clicking on. FaceIndex seems to return -1, what am I getting wrong?
I think FaceIndex should return something other than 1 if I am clicking a static mesh object, here, I am not. the mesh lives in a BP as a component
so I can get the Hit Component, which I assume would be the mesh
not sure how to get the FaceIndex from there on though 
since the hit result is broken and the face index is fetched before I can get the mesh stuff from the component we are hitting
Has anybody encountered their delegates not binding after casting on mobile? I find it often I need to add a slight delay after casting to a specific class so I can properly bind/access variables
I haven't really found stuff about it this anywhere and I was wondering what do y'all do with this "issue"
That sounds extremely strange ๐ค
Indeed, I have no idea how I even found the "fix"
What does your binding logic look like?
I keep putting stuff in airquotes cuz this is very sketchy to me
Let's see, I do a cast to my gamemode to get a reference to a manager and afterwards I bind to that manager one of it's delegates
and that bind fails if I don't have a slight delay before the bind
is the manager spawned or in the level?
Ah... it is grabbed on beginplay with "get actor of class". It is in the level already however
by the gamemode
It could be that for some reason the beginplays run in a different order on mobile
I'm not sure if the order of those is guaranteed
the casting is happening in my menu widget
on event construct
I would guess the widgets are probably the last of the stuff being spawned/handled
If you create the widget from your HUD's or such beginplay I think that's when they get initialized
the construct is called afaik when the widget is added into viewport, so if you build and add the widget to viewport, it probably happens in sequence
Yeah, it is created and added to the viewport within my HUD class on begin play
Hi, is it possible to create a sizebox in blueprints, i can see how to create a widget but not a raw sizebox
Yeah sounds like this could be the problem then if the begin plays run in a different order
I see
I can't really think of any other reason why it would fail like this
weird part is the cast doesn't fail
I'm doing something similar with managers in my game - in my game mode, I have an event I can bind to to check if the managers have been initialized
what are you casting?
the gamemode?
the gamemode itself is immediately available, but its begin play might not be immediately called
@light glen use Construct Object if you need to create builtin UMG widgets
I think I misspoke, I am accessing a variable from the gamemode and casting on it
I suppose it should fail if it's getting messed up before it
So you're doing Get GameMode -> Cast to MyGameMode -> Get MyVariable -> Cast to Whatever?
yup
Yeah the final cast definitely should fail if the value hasn't been initialized yet ๐ค
thanks @earnest tangle
I'm doing something similar with managers in my game - in my game mode, I have an event I can bind to to check if the managers have been initialized
@earnest tangle Are you getting a callback from your managers that call your "completed initializing" delegate?
Yeah, I have a "Are Managers Initialized" boolean value in the gamemode, and if the value is false, I bind into the delegate
I feel like I could probably do it in a slightly better way by using interfaces and calling a function on all objects implementing it or something but I set that up a while ago and it works so I haven't changed it yet :D
I feel ya
Did anyone else find their blueprint diff feature broke in 4.25?
So I have an ActorComponent: BPC_PotionRecovery. This handles all the logic for potion recovery. Attach this component to any actor.
Then I have an interface: BPI_PotionUsable. Attach this to anything and it represents that the thing can use potions.
I have code that checks if something implements BPI_PotionUsable. Doing this, I know if something can use Potions.
So basically, a character/enemy that can use potions will:
- Implement
BPI_PotionUsable. (Tell others that they can use potions) - Have
BPC_PotionRecoveryattached. (Logic for potion recovery)
However, to make things cleaner, here is my idea:
Remove the interface completely.
If I need to see if something can use potions, I'll just see if it has the component attached.
Are there any downsides to not using interfaces in this case? Is there a better way?
Any idea why Text is appearing as an output instead of an input for a function with signature UFUNCTION(BlueprintCallable) bool validateMatchID(const FText &text)?
Nevermind, I forgot UPARAM(ref)
heya, i need a lil help, basically im trying to set up a direction dash, doom style, and was trying to use the "launch character" node, but every time i try to use it, it warps the player location for a split second but ends up moving them not at all, any idea why?
Can someone help me with that bug:
https://www.reddit.com/r/unrealengine/comments/j948kv/multiplayer_advanced_sessions_session_joined/
THANKS!!! โฅ
1 vote and 5 comments so far on Reddit
How is that a Warning and not a compile error? Can I change the severity of that warning? It was caused by a param rename in C++. I've been chasing a bug for 2 hours because of this
I'm hiding the "head" bone on my enemy when I shoot him in the head. But is there a way to also get child components attached to that bone and hide them as well? Things such as hats, etc?
https://gyazo.com/2a0c37ced0f62d06d434db2d19d34419
any idea why this gives me an "accessed none" error on the Add To Viewport node? this is inside my player character BP, and the widget actually does get added and functions fine... but still gives me an error afterwards.
@still trellis I had the same problem. For me it happened because I was adding UI in a multiplayer game and you have to add widgets in the player controller using Owning Client event replication.
How can i get children primitive components?
Ah it just occurred to me that begin play on the character might happen before on possess
is there a way to automatically apply blueprints to certain meshes when importing level geometry? for example, adding door blueprints to objects named 'door' etc
Hey sorry kinda of new
any help this only shows on the local client
not the other clients
Does anyone know how to store a possessed pawn when loading or opening another map? Right now it keeps defaulting back to the original player pawn when loading another map. Please @ me. Much is apprecaited! If you can point me to a tutorial or send me steps on how to do it that would help out greatly. Thanks!
@opal stone Take a look at the 'GameInstance' blueprint. It stores info when transfering through levels.
Does pass-by-reference on arrays to functions not work?
I passed in an array of enum to a function with a timer loop
Then modify it elsewhere, but it doesn't see the update in the function
The logic of that doesn't sound right
Values that are passed as parameters to functions only exist in the function for the duration of the function call
Something else cannot modify those values during the function's execution
How do I make it by reference?
The player has an array of potions. There is a function that gets passed that array of potions and reads it and does calculations. However, outside factors affect the player's array of potions should be seen in the function as well.
Just want to pass-by-reference an array of stuff, it's possible, right?
I mean... you can do it with normal programming.. I can't imagine it not working here
Pass by reference should definitely work
If you tick the box for that then it should do it ๐ค Not sure why it wouldn't work, maybe you don't have the same ref where you're modifying it?
I did tick the box.. Hmm
Same ref?
I mean if it's a copy where you're modifying it instead of a ref to the same value
@violet wagon Thank you! I'll take a look!
hrm..do delays not work the way I thought they did? I have a UMG that takes an array of battle command and executes them. I told it to reveal one line of results, wait a second, then reveal the next and wait a second after that. When all lines in one command are shown, I told it to do a 2 second delay then start showing the second commands results.
It ends up blazing through the commands, not showing any until a couple seconds later, at which point it shows what might be the last command's result.
Day 2 of me asking without an explanation, Is there any way to real time edit an engine on a vehicle as it is not exposed...?
@earnest tangle
Am I using pass-by-reference incorrectly?
I have a variable in Actor. I pass it into Setup in ActorComponent.
In ActorComponent, I have it print out the value of the variable every tick (which is -10).
I change the value in Actor (by pressing 5 so it should now be 500), but in ActorComponent it is still -10. It should've changed to 500, since it is by reference?
So I have a blueprint using a Branch, but I needed to add another condition, and I figured instead of adding another Branch, I'd just make the first branch use an AND boolean that checks BOTH conditions. And it seemed to work fine. But I kept getting error messages whenever I exited Play. Using two branches, no errors.
Anybody know why?
can I inspect UMG widgets at runtime
that is the only thing I have in my HUD
Can I inspect the blueprint at runtime?
I can't find it in the world outliner
General architecture question. This relates to UMG but not only so putting it here.
context:
A VR game where I have a UI which lives in the main screen of an aircraft. In addition to the main screen I have small vertical screens next to the main screen. These have button icons that change depending on context. These commands will be used by pressing "physical" buttons next to them. Physical buttons are missing from the capture here, also there is only the Left button bank right now.
My current plan:
Button overlap will send a "pushed" message to the Widget with the button icons (Navigation, tasks etc. in the capture) . ButtonBankWidget in this case.
The ButtonBankWidget will handle changing commands, colors and text on the button icons and when pressed relay the command both to the main screen widget which will load appropriate layout and to any external places it needs to go to.
Is this daisy chain approach bad?
The button icons already have functions to change the content (color, command, text) so I thought they might as well do the executing but not sure if there are issues with doing it in a widget rather than another kind of actor.
Thank you for anyone who bothered to read! ๐
@ember dawn I bet you're doing an ISVALID check in one of those booleans. You'll have to show a picture.
because perhaps before you were doing an ISVALID and then checking the property on a reference, but now you're looking up a property on a reference before confirming its valid
just a guess
@modern cove It sounds like you might be trying to use Delay nodes inside of a FORLOOP?
that is a big nono
I saw a demo of a custom Macro For Loop with Delay and tried that but it didn't work either
@ember dawn Actually that kind of IS an isvalid check. The top boolean is checking to see if you hit anything. The bottom value is checking the SIMULATINGPHYSICS on a component that might not even exist. You need 2 branches here, because you shouldn't ask for a reference to the Hit Component unless you know there was a Hit at all.
@mellow folio Gotcha. Weird thing is it still worked, it just gave me errors afterward.
I also tried a new method where an Event Tick would display the lines one at a time based on a quantity that grew each tick, but attempting to use While Loops to hold up the process until the messages were all done caused it to complain about Infinite Loops
@ember dawn Yeah the engine hates bad references like that, definitely don't want to leave those, even though it technically works
Wish I could combine LineTraceForObjects and LineTraceByChannel. They both have parts I need and I'm having trouble replicating them myself.
@modern cove Is this coming from an Array of things?
kinda
@modern cove You should just create a literal loop with a delay node in there. Never use FORLOOP nodes with delays inside.
Try something like this maybe
but whatever you're doing I'm fairly sure you're overengineering it
beddie bye
I'll see if I can build something like that
The proper way to do functions/events that loop over time is with timers https://docs.unrealengine.com/en-US/BlueprintAPI/Utilities/Time/SetTimerbyEvent/index.html
Set Timer by Event
you can set them, clear them, etc... lots of timer-related nodes available
maybe next working session I'll have to scrap my current Battle Execution Process and try something like that
Ok so i have a dino game, im trying to figure out the best way to set up eating, i have the thirst and hunger going down, and will go up if i set up a trigger box with the function to add hunger or thirst connected to the trigger, well next step is how do i set that up on a actor, so i can press e on it, it will disappear and use the add hunger function and make hunger go up, anyone have examples of the best way to do this
or even a tutorial, cant find much on eating, or kill actor then eat it, seems to be a issues people dont commonly have
Anybody know a way to check if something from a LineTraceForObjects is Visible, in the same way that LineTraceByChannel does? Need to make sure I'm not tracing objects through walls.
What the heck.. am I going crazy here:
Default value of float is -999. Pressing 5 key should change the value to 500
But all I see in the output is -999, even after pressing 5
If you turn off the event tick, can you confirm that its registering you pressing 5?
Only two pieces. Gotta test them individually.
Instead of telling you to value on an EventTick, try making it tell you the value when you press 6
Then press 6, then 5, then 6 again
You mean like this?
The output when I press 5 is:
500
500
No, I mean like this
Press 6 to test if the default value is correct. Then press 5 to change it. And then press 6 again to see if the change worked.
Try hooking it up to EventTick again to see if the problem comes back. We've established it should work.
I hooked it up back to Event Tick, still shows -999, even after pressing 5
Are you also seeing the same behavior?
4.25.3
I'm still on 4.24
Might be a 4.25 issue?
If you need a timer there are alternatives to EventTick
I try to avoid using EventTick myself
I'm using Event Tick as an example to figure out pass-by-reference, which I still don't understand how to use
But even before that, there's this issue
I can't believe it
I'm a novice and know nothing of pass-by-references, so I'm afraid I cannot be of help there
I just can't believe it.
I made a brand new project, tested it. It works as expected.
But when I do it on my current project, it has that issue. I remade the variable. Nothing should be modifying it.
Is my project corrupted?
What else have you done in this project? Anything?
What happens if you try with, say, an Integer variable instead of a Float?
Happy to be a rubber duck!
i kinda need help not gonna lie, i want to know if there is a way to change gamemode in runtime using blueprints?
Hey can any one help me to change duplicate an actor if it's position is changed anyhow
Hey
Paul
Are you typing a book
@wicked vale not even remotely
oof
Hey can any one help me to change duplicate an actor if it's position is changed anyhow
hello!
Math question:
I have a location in the world which calculates the distance to the player character (get distance to node). I've clamped the result from 0 to 10 so when I'm at the location the value is 0 and when I'm far away the value is 10. How can I inverse the value? So that when I'm at the location the value is 10 and vice versa?
10 - value
that results in a negative value but I just wan't it to be inversed
like... not minus inversed .. u know ? ๐
So on vehicle component the values seem protect, none of the values are editable realtime for things like speed and such (like if damage is dealt to car lower its speed), Is it possible to expose these values into blueprints without breaking physx ๐ค
@sudden spear map range clamped or a lerp could give you that
how would i delete save game object from savedgames folder? Should I just overwrite it with an empty file that way it takes no space but i can use it later if needed?
Could anyone help me? I have a door that makes asound when opening and closeing, it opens when i enter a trigger box and closes when i leave, but right now the sound playes while i move around in the trigger
@grave relic Check if the sound you're playing has loop enabled?
that results in a negative value but I just wan't it to be inversed
@sudden spear no it's not
@haughty ember Is dosent have looping set to active
@grave relic Remove the Play Sound -> Play connector. Do you still hear sound when moving around?
Same question when removing Play Sound -> Reverse connector
I still hear sound with this
Do you still hear it when disconnecting each of those lines as well?
When its like on the picture sound still plays
You write that the sound plays when you move around in the trigger box, but does it start playing what seems to be every frame, or less frequent?
The sound playing is just a symptom of how the On begin/end overlap works. ANY object will trigger these, assuming their collision overlaps. So if you have a character made up by a lot of primitive components, as each of those components overlaps the triggerbox, each will trigger the overlap event.
No he's using box as an component
What you can do is to query what overlaps. And use a simple state machine for the door. For example, it shouldn't transition to the opening state, if it is opening.
So it plays every time it begin overlap
Just on begin overlap cast to your player character
And then do this things
It is also possible that the door itself triggers the overlaps.
I'm trying to make a test array with 3 different entries. However, when adding said entries to the array in one single frame it adds 3 times the same entry. Anyone know why this is?
The entry variables are steam item structs
Its only when i walk around in the trigger myself, im useing the normal FPS player
@grave relic The fps character has a component, that is supposed to be the gun, does it not? So there's 2 overlaps already, one for capsule and one for the gun, as you enter the trigger.
The best thing for you to do, is to print the actor and component to see just what is triggering the overlaps.
@grave relic The fps character has a component, that is supposed to be the gun, does it not? So there's 2 overlaps already, one for capsule and one for the gun, as you enter the trigger.
The best thing for you to do, is to print the actor and component to see just what is triggering the overlaps.
@elfin hazel rather than that while overlapping with box. Check the overlapping box actor by casting and for successful casting follow the open /close part
I figured it out @elfin hazel @weary jackal, it was almost what you both said so i when into look, in the original FPS controller for some reason is there a tiny sphear collider on the camera, remove that and it fixed the problem :=
๐
@haughty ember
I was wrong. You're right of course. Except that you didn't mentioned that I need a absolute node (or maybe also another node which I don't know) to get a positive value out of it. Anyway, this works now. Thanks all ๐
@sudden spear You don't need abs. If X is between 0-10, and Y = 10 - X, Y can only be between 0-10 as well.
I need time to process this ๐ ๐ญ
Take a paper/notepad and write all the possible values of X for the formula 10 - X. That is
10 - 0
10 - 1
10 - 2
..
10 - 10.
See the result of each one. That should help
I dont get it ... how should the graph look like? Maybe I'll get it then
just without abs
That results in 0 till -10 ( -10 when I reach the desired location)
I'm probably just too bad at maths ๐
Sorry for being confused^^ and thanks again
hi guys ๐
A timer perhaps?
It's worth noting for learning purposes that Tick has the length between each frame. The Delta Time. You could add this up until it is >= to 5 and then do your thing. Then set that counter back to 0.
The timers essentially do the same thing, just in a more efficient way in a manager class.
I asked this question before, but where should I plug these https://gyazo.com/61da94ae11fcc260607f38104f115aa2
If you mean the event, drag from it and search for "custom event"
Is this for a timer?
you'd usually connect the exec pin so that the node gets executed in the sequence you want it to
yea
right, so it depends on when you want to start the timer in that case
for example, you could connect it from Begin Play if you want to immediately start counting it down
The linetrace doesn't show up but the print node is executed
Hi guys, Is it normal that the function GetInputKeyAtDistance returns the percentage of the curve instead of the input key?
Hi, im new here. was a happy accident finding this discord whilst searching for an answer to my problem, I started ue4 3 days ago and this is my first attempt at making a ball bounce and then reset to 0 on landing, it all goes well up until it lands and the "event on landing" doesnt fire, can anyone help me out with this please, much appreciative ๐
Hello! I want to make a cast to ControllerBP, but i dont understand how can i make this. it is possible?
What add in OBJECT?
@ancient topaz is it a player controller?
No, this is vehicle pawn
so you need that pawn reference to cast to it
recommend you check out here https://docs.unrealengine.com/en-US/Engine/Blueprints/UserGuide/CastNodes/index.html
Examples of different Casting Nodes and usage cases.
I got a friend who built a game mostly using blueprints. One issue he is having is that now replacing outdated content such as the UI takes a significant amount of work as he has to fix and adjust several blueprints for each piece. Anyone with more experience have a good idea of how to fix this quicker and/or with less effort?
Hey
how do you use Add Movement Input with Get Actor Forward Vector?
I've tried this setup, it works fine until I try to go backwards
then it just starts violently shaking
@quartz gazelle what engine version?
whatever the latest is. 4.24 iirc
@gilded pebble check out https://docs.unrealengine.com/en-US/Gameplay/HowTo/CharacterMovement/Blueprints/index.html
A How To Guide for Setting Up Character Movement in Blueprints.
@quartz gazelle thats what he build it with?
Well, he has been building the game for the last couple years. But he updates his code and engine with every update
normally you dont want to update in the middle like that but ive done it with one project also from 4.23 on and have not had any issues. What exactly is breaking?
I have that already, what I'm trying to do is to disconnect character movement direction and controller forward vector
so I can look elsewhere while moving
@gilded pebble in camera uncheck use control rotation most likely?
the black line is a debug line made from the actor forward vector if I go backwards
and same line if I go forwards
Well nothing is breaking. He is just running into things like wanting to update his UI, but in order to change just a piece he has to adjust like 15+ blueprints. So I was wondering if there was a better way to speed him up.
so it seems that the forward vector of the actor violently changes when the character moves backwards
@sacred gate I've done that already
i think you may want the controller forward vector rather than actor maybe
yes, thats the basic setup, but I need to be separate from the controller's rotation
so I can look around while moving
yeah so you will need to go off of the control rotation for that
so if you open a blank third person template thats basically how its set up
yes, I've done that already
but the problem is that the thirdperson templace characters uses the forward vector of the controller
what I need is the forward vector of the actor
why?
because it's very basic to only be able to move in the direction you are looking
I would need a system with which I can move in one direction and look into the other, it's very useful in tps pvp situations
thats exactly how the third person template is set up. unless im missing something im not sure why that wont work for you
the third person template is very simmiliar, but it uses a the forward vector of the control yaw
how i can set a Class Array parameters in blue print ? how to access them ?
yeah im not understanding why you need actor forward. you can move in different direction from what you are looking in with control rotation forward
@rough wing it works on event hit, but then when you touch a wall or a ceiling you get your jumps reset.. thats the problem lol
as you can see on the top left corner, the actor forward vector wildly changes if I go backwards.
this is a fresh project with the tps templace
any way to fix this?
thats because forward vector is just giving you a direction. you are moving backwards but the forward vector is still pretty much the same
try this
should give you about -1 when going backwards and 1 when going forwards
it should, but it doesn't
for some reason forward vector complete and the yaw rotation of the character is jumpin all over the place when moving the character backwards using the actor forward rotation
i think this is what you want
actually i dont think you can use add movement input how you want
you would need to do something like this
guys, quick question.
what is the cheapest blueprint class i can use? is there even anything like that?
I'd like to create an actor/scene component or whatever is cheapest for that, spawn and attach it to the player character and let it handle all the sound.
so far i have figured out that only actor type blueprints can have timelines. what do you guys think?
i know there is just this basic "object" but is it the cheapest? ๐ค
Try this @gilded pebble
oh you said you had it unchecked earlier. ok good then
I unchecked the controller one
turns out there is one in character movement as well
Hey everyone! Correct me if I'm wrong, but currently there's no way to change a level's tile position inside a blueprint, when using world composition. You can only set it manually, once. Right? Tried setting the transform, but that didn't do nothing, or get the tile value I added before (as a reference).
Im so confused, "event on landing" works on ue4 third person character, but not on my own character blueprint classes ๐ข
How do you know if it's by reference?
I have this function:
If I add to the array of structs somewhere else,
top will not reflect the changes
bottom will reflect the changes
Obviously that means for the array of structs, the:
top is pass-by-value
bottom is pass-by-reference
But why? Is there a way to always pass-by-reference (there's no tick box option for these things)?
tbh this is part of why I moved some of my data processing to C++
the distinction between value, pointer and reference is much more clear there
@earnest tangle Is there a way to tell which is what?
Or really, a way to make it so it's always by reference
I think you would have to manually make sure you never pass it by value or copy the value
It might be easier to just store the value in one place, and access it from there. This way you wouldn't have this problem because everything that accesses the value is always accessing the same one
@willow tendon as in, you're directly rotating or tilting an actor by calling a function on the actor from you widget?
I have the variables stored in the component to make it flexible and reusable, so at least in this case it makes sense for it to be there
But I'm surprised you can't do something so basic as pass-by-reference for these things..
It might be partially caused by BP being an abstraction on top of C++
You could probably do the logic in C++ quite easily while still allowing the rest of your code to be in BP's
I guess it kind of depends on how the widget is designed to be used
I usually have an event dispatcher on my widgets, and I bind into it to do something with updated values
its mroe of a debugging widget for quick access to variables
Yeah if you're using it to directly poke a specific actor's properties it seems like this is an entirely valid method too
The reason I'm doing it with dispatcher in my case is I'm not necessarily 100% sure what I'm going to do with the data
oh LOL
Yeah that's definitely a good way to do it lol
It looked like a regular old function call at a glance
no sweat, my issue is... on my other actor
not sure how to 'point to' that widget
has to be a variable in the new actor?
at least in my case I bind into the widget's events where it's created in my HUD
how can I edit inherited content?
you mean component by content?
if yes, go to base class and set "editeable when inherited" to true
@willow tendon You theoretically have access to the Instance of that Widget when you create it. The CreateWidget node returns it.
From there on it depends on where you created it and if you can get a quick reference to that Actor.
EventDispatchers can be used if you need something generic. If your Widget shouldn't care about who uses those events.
If this is however just to control one specific Actor and nothing else, than creating the Widget in that Actor and giving the Widget a reference to the Actor should be enough.
oh
so in my other actor BP i'd just make a var to that widget?
essentially what im saying is, i'd like an "on value changed" event handler elsewhere
Ehm, yes and no. A Variable to Actors, Widget or other Objects is empty by default. It's like an empty box where you can put an instance of it in.
If you just make the variable you won't be able to access it (you will get "Accessed None" errors if you try). You'd need to fill that variable with the return value of the CreateWidget node.
Hm, so you want a very generic event that can just be hooked into at any time to receive the Widget values?
yeah thats what im shooting for (im just prototyping things for an actual UE programmer)
heh
Singleplayer?
Okay so just for this then:
multiplayer thing, god knows where the other dev team is on it
yeah
i jsut give them simple lil previs projects ancd say 'do that, but make it work and better)
hah
learning along the way tho, so thats good
What you can try is:
- Create the Widget in an Actor that is easily accessible, for example the PlayerController. There is a "GetPlayerController" node, which you can use to get the reference to your PlayerController.
NOTE: That's not so straight forward if Multiplayer! - Save the CreateWidget return value into a Variable that exists in your PlayerController.
Whenever you need it you can then grab the PlayerController with the Get node and cast the return value to your own class and access the widget. Then you can bind to the Delegates of the Widget.
Let me know where you struggle with it
that sounds good (except for making the widget in the actor, im already doing that kinda on its own in my level BP)
You won't be able to access that Widget. :D
well therein lies the problem huh
LD
well , ill just move it to its own actor then
It's also generally not a good idea to put that code into there. UI Code and specially input related stuff should be in teh PlayerController
It's fine if you use C++, as you can access and extend it from there. Just BPs are not the best in utilizing it
roger that
cool, just made an actor and threw it in the scene.
If you drag that pin out in your PlayerController (once you moved it)
There is a button at the top about creating a variable
Forgot the exact term
That makes sure you have a proper variable directly without having to manually select the type usually
ah thats handy
cool, just made an actor and threw it in the scene.
Honestly also not the best idea. You can't get the reference to that Actor easily.
Hence the suggestion to move it into the PlayerController class.
Right, so you know how to create new Blueprints in the Content Browser, right?
Did you ever create a GameMode based Blueprint?
Right, so the GameMode (since UE4 is for games), defines the rules and what classes of UE4's defining gameframework are used.
Part of that is for example the Character Class you wish to spawn
Or the PlayerController class
ok
Once you created your own GameMode class and you open it, you can find those settings in the ClassDefaults of that BP
You would then also create your own PlayerController class and assign it in your GameMode.
The GameMode can be set either project-wise or on Levels
Top
Hi. Someone know how to get camera reference from level in player character blueprint?
@willow tendon
If you open that BP up you should see something like this in the Class Defaults
If you create your own PlayerController, you can assign it there
gotcha
You can set the GameMode default in your Project Settings
Hi. Someone know how to get camera reference from level in player character blueprint?
@sharp fox Posting the question directly again will not make me answer you faster. I'm busy with someone else atm first :P please wait.
ok ๐
@willow tendon Top left of your Editor "Edit" -> "Project Settings". Then in the Project Settings on the Left you can find "Maps & Modes" and there you can select the DefaultGameMode.
go ahead, im gunna delve into this... just one last thing, so now that BP that summons my widget goes in my playercontroller eh?
yeah ive done that now
Awesome
The code that creates your Widget goes into Cube_PlayerController
For example BeginPlay
awesome
@sharp fox you could always make your camera in the level be a blueprint, thenn on your character/controller do, Get all actor of class
Again, not Multiplayer friendly, but enough for this
yeah. thats fine./
To confirm that your GameMode and PlayerController are actually utilized you can press play and double check your World Outliner (top right of the Editor by default I think). It should list them.
yeah saw them when i did all that
so now that im in the player controller doing this widget overlay... i'd still have to get the player controller and send it as a var i guess
Ah
No, just rightclick the event graph and search for the variables again
It's basically just UE4 being stupid
It wants a version that does not have the Target pin as the variable is part of the PlayerController anyway
@sharp fox You have a camera in your level that you need a reference to?
get
By using a GetNode