#blueprint
402296 messages Β· Page 426 of 403
that way you handle all the cases, even in the case of off grid
you'll get something along the lines of cities skylines
you'll have to couple that with collision detection etc., and ideally you'll have that be a small part of your road builder blueprint, after which you'd want to put down logic as soon as the spline meshes have spawned
Ill have to read up on splines then, dont know much about them atm lol. Ty it at least gives me a heading
Quick question, how do you group variables, I can see there are already preset groups, for "My Character" and "Components", can I make my own?
CranzEstebogen thanks for info on custom events not taking timers, I gues an event for the timer that fires up the actual event I want to repeat? lul
depends on what you want to do
@arctic rune Select the variable and there's a Category field. Can have sub groups with | like Food|Breakfast or Food|Dinner
@distant sedge Yeah, but how do I make a new category? It only has 3 options, default, my character and Components?
Type in the text box
Nevermind I was being stupid, thank you xD
TYSM
Hi
I'm trying to add all my velocity into one plane
I don't want my character to add velocity in the yellow direction
This is my code
But it's only working in one way
you take your velocity, and project it on a plane
and plane normal is wall normal
bonus: calculate the projected velocity and lerp it with original velocity to control how sticky the wall is
well not really, you just added some arbitrary +90 yaw axis to something
when you can actually get the normal_vector with simple trace
Oh I see
so the plane normal is not the direction of the restriction
but the normal of the plane were walking on
is along the same axis as the wall
if you do the planar projection from ground normal, that would mean you can't jump
Just wondering, any of you have any experience with moving where the player spawns. For example I want the player to enter a room, when they do this opens a new level, if you exit that room you go back to the previous level, but I cant seem to get the player to start where they were before entering the new level rather than at the player start? if that makes any sense π
so you want a loading screen level change and keep the player in position of where they were?
@arctic rune you need to store the last known position of the player when they are entering the door. Then when you spawn your character in, you can set the location according to the last known then hand control over to the player.
You can also set the rotation to look away from the door as part of setting the player position
Why not have level entries and exits instead of recording data... on level spawn move or teleport pawn to loading point
@fair estuary and how do you propose to do this when the last known position will be based on the previous level's pivot?
@arctic rune you need to store the last known position of the player when they are entering the door. Then when you spawn your character in, you can set the location according to the last known then hand control over to the player.
@fair estuary You can store data (Player Rotation, Location) in player Instances, they transfer between level changes
the problem is still you're on the new level's pivot, so unless the pivots match up you're not going to spawn in the correct place
older games used a landmark system which was a standin for level pivot changes
The location of a point in the level is always the same right?
nope
not if you transition between levels
like yes, if you use a position of (0, 100, 100) that is still equal to (0, 100, 100) in the new level, but at that position in the new level there might not be anything
unless you line everything up flawlessly for every level
Wouldn't that depend on level streaming though? If you're not level streaming then 0,100,100 as the last point in the previous level will still be 0,100,100 in the previous level.
You wouldn't need the previous level's pivot. Presumably there's a door in both levels next to where the character is starting at after "Walking through the door". Just know where the door is and face the character away from it.
@fair estuary this isn't streaming though, first, and second the location doesn't matter. what matters is the level carries the player over to the new level in the exact spot required, not absolute position
you don't need the previous level's pivot
the way old games went around it was by using relative location to an actor
so in the example of a door, on triggering the level, you save the relative location from the door, and when the new level pops in, you transfer to the same relative location from the door
the door essentially becomes a working pivot
I think he meant to save the location of a point near the door that is rotated properly facing away.
which is what we do for our game.
well yeah but that's not the same
that's just spawning the player in a new location in a new level
Correct. using a direct last known location wouldnt be possible because the last location triggered the change level screen
so you really have to use a point to spawn at based on last known door you went through
@karmic pebble not true, since relative location stays relative. if you have an actor that propagates to the new level or put a stand in actor for this exact purpose you can get the exact transform the player had in the previous level, in the new level
I don't think so
but it's a question of how much manual work you want to put in
and what you're expecting in terms of level transition
but your suggestion isn't so much changing levels as just spawning a new level with a new starting point
is all I'm saying
anyway with origin rebasing in the engine, that is also a solution, perhaps one that is easier
Hi all,
I've got values along the extents of a box in y and z that are remapped to zero at the far extents and 1 at the centre and i'm looking for the maths to combine them into a circular falloff where the centre of the plane described by y and z is a value of 1 and then the values scale smoothly to 0 in all directions outwards. Hope this makes sense π
I've got a technical question about blueprint order of execution.
Let's say in a blueprint I cast to another to get some data back for the next node. Does the engine finish whatever the cast told it to do or just proceeds to the next node straight away ?
Is there a way to cast a line trace to a widget actor from scene, and debug detect buttons?
@fallen glade You need to grab the Actor that the Child Actor Component holds with Get Actor.
Anyone got any idea as to why only part of my blueprint execution flow is being diaplyed in the editor ?
- It executes all the code, but it never actually displays which route it goes, which is immensly frustrating D:
@elfin hazel thank you very much ! π
@wooden jasper if it's in game you have to select which actor to inspect by a dropdown on the top right
I already got it selected in the debug info - and it does show parts of it being executed - like at the end of a chain it will show like this: the execution starts at the event to the left :S
I've had the same problem before, sorry, can't help
how do you expose child actor variables ? :/
There's a get function from the component you can use
@wooden jasper ?
@fallen glade child actors aren't a good way of doing things. they're buggy and highly expensive for almost no gain
there are probably other, better ways of doing what you want to do
I was just trying to crate a debug level for my debris... the plan was to spawn the required debris from a list
@odd ember i'll find some other way
I think its called Get Child or something like that @fallen glade
@wooden jasper thank you, problem is variables are not exposed. I need to find another way
Think your best bet is to set all the variables after its created and then making an event that is called, instead of begin play, when that is done. probably easiest to make a function that takes all the data you want to set.
@fallen glade so why don't you use the SpawnActorFromClass node?
I need the variables to be exposed on spawn :/ I think I found another way
@fallen glade if you tick the expose on spawn tickbox they will be exposed on the SpawnActorFromClass node
that is the correct way to have anything spawn an actor in the world
If you're doing stuff during construction, move it to a function you call.
There's also this: https://issues.unrealengine.com/issue/UE-62458
Another requirement is to spawn before begin play .... thank yopu for letting me know of the correct way @odd ember but this i'm making is just for testing purposes
@fallen glade begin play of what?
in construction script
so you're doing it while in editor?
yeah
shouldn't make a difference
the actor will still spawn, but no logic apart from its construction script will be executed
SpawnActorFromClass can't be called from construction script
I see
so can you talk me through what you are actually trying to do?
You can use an utility actor.
a debug level for your debris doesn't exactly tell me anything
so like a preview scene
that seems like functionality that already exists for destructible actors
while keeping the ability to toggle variables
you're doing an editor extension in either case, so you'd need to use utility blueprints, not regular ones
yeah, the workflow is different but the idea is the same
you'll have to think about UI as well etc.
mmm, i'll look into it ! thank you
might be better for you instead of attempting to shoehorn functionality in where it can't or won't go
I guess
@signal cosmos #animation
hey, when I have an instance editable object reference var in the gamemode bp, where can I set it in the editor?
Will False && B evaluate pure function B?
Pretty sure it will, but need confirmation as this looks a bit weird and unusual to me
Should actors construction scripts be running in editor if their the streams they are on are not visible/hidden? I have actors that are all running construction scripts even though they are on a hidden stream.
@terse harness you... can't really
game mode isn't an actor, it's an object
its instantiation is concealed from the editor
@severe iris shouldn't no
true || and false && don't evaluate secondary conditions due to optimization
at least in code
but I doubt the wrapper is different
by wrapper I meant the BP wrapper
but there could be some edge cases wherein for instance a select node would evaluate regardless
For example try length(array) == 1 && array[0]==something
This throw an error in console for me
so if it throws an error then it probably evaluates both, depending on the error message
Yes, that's what I'm saying, it complains on illegal access on empty array
you can debug it to see what the actual evaluation is
but it might be that the BP VM can't not evaluate
@odd ember ok thanks, what is the best way to call an event in another bp from the gamemode bp then?
entirely depends on what you want to call
generally though the game mode shouldn't call anything, but rather listen in on calls made by others
ah ok, I should probably just call it from somewhere else then
what are you trying to do?
call an event in a specific actor in the level that sets the visibility of the actors widget component
can you be more explicit? like a UI for a player let's say?
is there a way to check if a device is plugged via USB?
ok, there are 2 power switches in the level, when both switches are flipped within 2secs of eachother, the power turns on, activating a display on a keypad
i was using the gamemode bp to check if the switches were flipped close enough to eachother
yeah
2 Problems.
- When my window isn't active my vehiclepawn is moving. Shall i simply pause the game, when the window isnt active?
- When my Joystick isn't attached unreal still recognise a joystick input
ah right the display on a keypad is in world as well, right?
in that case just use the level blueprint
@thorny cedar 1: yes. 2: this one is a bit harder, are you cpp familiar
my project is cpp based, but im glad if you can help me to dig deeper into cpp, if its not that hard
@terse harness so widget components generally need to go on actors that use them, unless they are placed arbitrarily in world. e.g. a 3d "screen" with widget choices
have to use cpp files for some config file for a 6DoF simulator
@thorny cedar I don't know it on top of my head, but I suggest you look through stuff like PlayerInput.h/cpp to see if that links out to some USB connection. from there you should also be able to look for links to hardware delegates
how can i check, if my user has the current UE4 instance active?
any variable of player classes?
It says this is an infinite loop. Why? It has limited amount of overlapping components, so how?
@thorny cedar probably somwhere in GameInstance
ok, so I want to make explosive barrels that make other barrels explode, but it seems the barrel also targets the barrel that made it explode which creates infinite loop, how can i prevent it?
I think I fixed it, but now it errors so hard, it sends me to to standard macros blueprint
how do i triger an event in widget BP that is defined in actorBP and this actor is casting to a pawn BP.
how is it defined in actorBP
where is the widget
for enemies that drop loot, is it better to use a BP interface or just a custom event within the master enemy class?
widget
where is the connection between widget and actor?
@little nacelle depends, are enemies the only type of interaction that drop loot?
i added an object reference to the actor
the print string is working but the event isn't
they are not, however if i was to use a BPI wouldnt the "killer" need to be the caller?
like there will be enemies and destructible objects
both can drop loot, with varying logic on rolls
so what's the issue?
@still nexus can you show me the object reference in the actor?
and the logic
well the logic flow seems weird no? On the enemy's Event Any Damage, when it is killed, it has to tell the killer it has been killed, who then talks back to the enemy to tell it to drop loot, seems like unnecessary steps no?
why would the killer need to be involved?
isnt the killer the caller?
then whats the point of using BPIs?
@odd ember i didn't make a widget reference in the actor i only made an event and then call it in the widget on button press
@still nexus then how do you expect it to know the widget?
@little nacelle the point is to have the same structure of functions for multiple hierarchies. e.g. you can Interact() with both a door and an NPC, but they each have their own implementation
right, so the one that interacts with them is the caller
in that case yes
do i have to reference it as a variable type object or cast it in the event
so in my situation wouldnt the player need to be the caller?
in your case the player killing them just kills them
the player doesn't cause them to spawn loot
THEY have behavior that causes them to drop loot or not
but the player doesn't know or care about that
defined by the BPI's event?
im just a bit confused because im trying to see why i wouldnt just make two custom events
ok thank you sir
seems like implementing a BPI for 2 master classes is more work than that
technically you should only start implementing interfaces when it is required, and your structure should be setup beforehand to make them work
so it'd just be a hook in
and how do i differentiate when its required? something like your example?
what you're probably looking for really is a loot manager
which is tied to a spawn manager
yeah i should really make a loot manager
so when you spawn an enemy, the enemy has certain gear that you probably want to consider dropping on death
because once the enemy dies, its cycle of responsibilities die with it
well my current project is a diablo-clone, so its just RNG loot, but the rarities and quantities will vary by enemy
diablo 2 still had an approximation of this
where if an enemy was carrying e.g. a spear they would have a higher chance of dropping a spear
yeah i used to think diablo randomly generated items from base ingredients, but then learned they had base classes for each item with a layer of randomization instead
oh thats good to know
TIL
do you know cpp
no bueno
as in, took 1 class lol
this would be a perfect candidate for a subsystem
is a manager class the BP alternate?
it's a UE4 specific cpp implementation that works as a manager class
it's just set up to work like that
there is no BP alternative
so a custom BP it is lol
yea essentially an object that runs in the background and receives calls to do certain things when necessary
yup yup
don't think you can do an object even in BP though
so you'll probably have to make it an actor
which is just extra faff
i mean you can create a BP of class Object
yeah but you have no way of calling that in every object
since it doesn't exist in the world, it isn't known by the level either
oh, yeah. could make it an actor component and attach it to the player i guess too
but yeah thats how my inventory manager works. its a BP Actor attached to the player
why would you attach it to the player?
and hopefully not a child actor
inventory you can do with components
child actors should be deprecated already smh
let me check
so on begin play my controller spawns the inventory actor object and attaches it to the player
the player isnt a child actor btw
well no of course not
but that kind of setup is fine
or well
it could just as well be a component
but if it works it's fine
it just precludes you from making it modular without extra work
yeah there's a lot of issues
so whats the "proper" way of handling inventory in BPs?
it's not part of the actor itself so you'll have to make manual hookups every time you use it
there is no direct reference between them, that is something the controller has to handle
oh, yeah i know, ive got InventoryRefs all over lol
where the controller shouldn't be involved in this case save for inputs
in the background the technical debt is already accruing
oh i know, ive actually been meaning to do a whole project cleanup, because i know i have unnecessary refs and casts that could be improved upon
the sooner the better
i wonder if GameInstance could be an inventory handler?
technical debt has a tendency to spiral out of control
and will prevent good design and architecture down the line
yeah its already become exponential for me, and i have a barebones project
really it just needs to be a component on the player character
my biggest issue with my technical debt is i dont know the "right" way of BP communication yet
because tutorials always show the basic logic, but dont inform you that its not how youd want to actually do it in a whole project
would it need to be something else if there was a global inventory?
like a shared stash couldnt be character specific, so im guessing that would be stored elsewhere?
yeah ill convert the inventory logic to an AC
so what you said earlier, in this kind of game, id have a spawn manager, that then uses a loot manager?
im guessing when it spawns actors, it decides the loot tables then?
you want the loot table to be decided at the end, not at start
because gameplay can influence loot
if you follow the concept of diablo's loot system
yeah or anything else
yea lol
thats a good point
Here's a dumb question. Print strings are showing the editor log but not on screen (in editor). Why? My gizmo keeps disappearing as well, and I keep having to turn it back on.
Open your level bp>>> begin play>>> console command>>> EnableAllScreenMessages
is there a way to use ForEachLoop in reverse?
ah yes, probably the ReverseForEachLoop.
never noticed it
So I know instances can be kind of hard to use with blueprints, but are player instances and game instances pretty much the same, as in I can use them the same way?
Hmm, can I save values to a player instance like a normal actor or does it require a bit more work and complexity
Hmmm no, I was told to save the player location in player instance so that it keeps the values between level changing
no such thing
Im basically trying to get it so if you go through a door a new level loads, if you go back through it you start at the same place you left, but I cant seem to get the location to save or teleport there and Idk what the issue is
So i could save the player location and rotation in a game instance then cast to that and use that to teleport the player?
you could
but
consider that saving the location and rotation and transferring that to the new level will have you teleport into those exact coordinates of the new level
not necessarily where you want it to teleport
So basically I have this so far, Im not sure why this dosnt work, Im pretty new to Unreal Engine so apologies if this is something really basic
Thats in the FirstPersonCharacter - And you spawn in level one (First person example map) if you go through the door - The top code - It loads the new level and starts at the player start. If you go back through that door - Back to the first level - You spawn at the player start and dont teleport to where you were last in that level
If that makes sense xD
Your refering to the set locatation and rotation?
yes
Okay I fixed that
Nothing changes
Stupid question, i have to create a new blueprint for that right? Or is there a preset one?
the game instance exists, but only as a cpp base
Also in game instance the keyboard E wouldnt work would it? Because its not being controller by the player?
it would work eventually, probably even before pawn
but I can't remember the input hierarchy
It dosnt let me add the event in the instance
Uhmm, Idk what that means xD
it means you trigger the custom event by putting a volume trigger or what have you in the level
Im not sure what triggereing by proxy is
or just have it trigger off begin play after a delay
whatever you want really
we're just testing
Im not sure how I set this up or how to use the volume trigger
Surely that is only in the level blueprint
well yeah
Im so confused
Yeah I can place it in the level, no idea what to do now....
is it placed?
It is
so on component overlap event in the level blueprint, cast to player character
the get game instance, cast to your new game instance class
then call your event
When calling the custom event what would the target be?
Nevermind I accidently casted to the class rather than just the instance
Hi, does anyone know a good way to set a boolean based on if an actor is in the player camera frustrum? I'm working with an HMD and thought there would be a way to get the view pyramid of each eye and just do an event overlap but i cant seem to figure out how to do it. The actor will be hidden in game/have an invisible material on it.
@fathom spindle check out the WasRecentlyRendered node
otherwise do it mathwise
there is no trace
for a frustum
Thanks @odd ember would that work with an object that has an invisible material on it?
ok on it
Hey everyone! Can anyone point me in the right direction on how to create a system that will switch between audio cues in relation to the player entering combat?
Print strings are showing up in the log but not in editor. Is there a disable messages in editor option im not seeing???
Yeah, I had the same thought right.
Its not that
My gizmo keeps auto hiding every few minutes as well....
@sand solar look up event dispatchers
Sorry @lapis obsidian, I'm not sure how else to hide/show those messages
Thanks @odd ember works perfectly with an invisible material! π
One more thought? Is there a way that I can have the player press start and begin in a already loaded level? (like a live main menu)
Do you have a pause menu setup @sand solar?
Not at the minute, just a pause functionality.
i have tried all stuff i know but nothing update my values at variables i have created a game instance and 2 functions per value 1 for set other to get the value but when i call the instance and i increase the value it doesnt update the value
why is it not possible to set and get single values from structs in bp?
@trim matrix it's possible, lemme get the code
why is it not possible to set and get single values from structs in bp?
@trim matrix cuz i need to pass the values between levels
@trim matrix
When you select the "Set Members" node, it allows you to pick which variables you're trying to set
What do you mean single members? I thought you were trying to set a single variable inside a struct
split struct pin? (or "break" to a new node, whichever suits your organizational fancies)
@pallid vector scroll to the far right on your message log and click the farthest right white magnifying class
That will tell you the exact node that's bugging, then screenshot that and post it here
That's the output log
we need screenshots of your Blueprint, where the magnifying glass takes you
@sand solar sounds like you should just start the game, then immediately call your pause functionality
What is to the left of "Get Consumo" and the branch?
Looks like you're calling the "Get Consumo" after you try to use it, which means the value will never be set, but need to see the code before to be certain
Which "then" number is the branch and the "Get consumo"?
Make sure the "Get consumo" is before that branch where you use it
@fathom portal Thanks for the assist! I'll give it a try π
Right, yeah, so you're setting the value at the "then 9", but using it before that at the "then 2", when it won't be set and will always break
And yes, agreed, that's... jumbled to say the least lmao
not to mention the performance hog it must be
Right, yeah, so you're setting the value at the "then 9", but using it before that at the "then 2", when it won't be set and will always break
@fathom portal
so this is the solution?
I mean, that's one way to do it
Yeah
Depending on what's after the "set consumo", you might just be able to use the branches afterwards
Glad I could help
I recommend organizing a bit
Might help fixing stuff in the future
@sand solar hows it looking?
That did the trick! Not sure why I didn't think of that earlier haha π
Sure man, everyone needs a little push once and a while
Little nudge in the right direction. You already had all the ingredients
@fathom portal now only doesnt update the values at the event overlapping sequence
Is there a way to generate or edit sound assets in UE4 with blueprints? F.ex. making a piano
Is there a way to generate or edit sound assets in UE4 with blueprints? F.ex. making a piano
@frigid anvil spawn a 2d sound
import as mp3
I know how to spawn sounds, but I am wandering if there is a way to edit or mix that sound to create other sounds with it
a*
bind the button with a spawn 2d if you press a bunch of them you will create a sound like piano
edit like equalizer
run time
i dont know but it might be in audio components
Is there a way to generate sounds though?
I was looking for something like this
So think I got it now
is it possible to use compute shaders with blueprints?
is it possible to use compute shaders with blueprints?
@gaunt mantle someone post something related in #ue4-general
oh sweet
whether or not it would have any net performance gain is anyone's guess
Does anyone have any idea why this map is not returning a valid reference to the widget? I tried with an array, and it only lets me get copy and not get ref
@latent shadow are you setting default values for the map?
No, all assigned at runtime
have you tried debugging to see what <k,v> are stored inside the map?
Yeah, It seems to be assigning correctly. Im trying to do it with an array right now, and it doesnt allow me to get a reference when accessing it in a function
only get(copy)
I get a popup saying "array get node modified: now returning a copy"
idk, might be something about particular data types only being gettable as copy
Weird, Ive indexed widgets and then retrieved references to them before
maybe it's this particular widget type?
Unless theres some class setting that allows it, it shouldnt be. This widget is just parented to the base class and doesnt have anything very advanced going on in it
strange
Can someone check out my question in #multiplayer ?
@spark robin just... expose variables in the widget on spawn? also it's not a MP question
Since there are multiple players, I need to have the player index of each, so it kinda is a mp question
But wdym by expose variables then exactly? I think I need an example
Set local vars in your player controllers and define them through casting from the player's widget
But how do I identify each player inside of the widget?
(Thats essentially my question)
Get the controller or owning player
Yeah but like, how :l
Hey all... How can I get two players to both view the same camera by default?
When you spawn a widget it is assigned an owner's viewport. Get player xontroller or get viewport owner.
Posted in Multiplayer chat but doesn't look too active. Some questions gone unanswered there.
Set active camera to a same actor
But its supposed to be fetching info from multiple players
How do I do that? @zealous moth
Tried just calling set view target on begin play
Works for Server but not client
(Ping me on further replies)
Client for some reason just snaps camera view to his transform
Server view^ [correct]
Client view^ [wtf]
Any ideas vastly appreciated @zealous moth
Feels like this should be simple to do π
You have to multicast it
Sorry for being a noob. Replication and multiplayer is something that's difficult for me to grasp
I would say more but i am babysotting
Setting it to multicast does the same thing Daniel
For the clients to be able to recieve the data, it must be casted to them. And multicasting can only be done from the server.
So try placing a second custom event after your current custom event, which you set to multicast
So by your first custom event, you make sure the code is running on the server (as clients can not multicast), and by the second custom event, you tell the server to multicast it (cast it to all clients)
@spark robin you can also send data via event dispatchers and have players subscribe it
You mean by custom events basically?
Ans event dispatchers yes
Yeah I don't get it... Sorry. This is pretty tough for me to wrap my head around π€
Casting implies finding owners and define their vars. Dispatching simply sends out var signals and whatever 8s listening or subscribed uses it
Fletch Im not that certain that its gonna work if you do what I said tbh, I really dont know if the code you sent in the screenie works in your caseπ€·π»ββοΈ
Strangely now I've set it to this, it works for the first couple of frames and then snaps the camera back to the actor transform on client:
Spawns, loads in correct camera, then puts camera back to actor transform
π
No ideas?
π’
What do you mean 'assign a camera'? Can you please elaborate?
That's exactly what I'm trying to do with the view target
@manic maple I believe your switch on authority's outputs are supposed to be the other way around, if the device running the code has authority, its the server, and should then multicast, if its a client, it has remote access and should send to server
I've never used the switch on auth myself tho, so I might not get it right (You dont need the switch on auth, its a unnecessary step in situations like this)
Switching them makes no difference unfortunately
Just sets correct camera for a few frames, then switches back to default camera if there is a camera component in the player Blueprint, or to Actor location if there isn't one
Lol, just a cheap idea
But if you like, Try removing the camera that belongs to the other character if you can (The one its switching to unwillingly)
I have tried with and without camera components.
It snaps the view to the actor location
If it does have a camera component, it uses that instead
Either way, it shows correctly for a few frames, then switches to one of the above
Only for the client though
Server works fine
Thats weird, I've never played around with separate cameras yet, so Im the wrong guy to help with this
Actually
I have an idea
I'm all ears if you can help me out right now because I'm at a loss, haha.
Really would like to get this working π€
Try duplicating what I circled in, to where my arrow is
So then the code will first run on the server, and then on the clients
This can be due to some checks the server does to make sure the client has the same config as the server kinda (I discovered this myself like a week ago when I first started working on multiplayer stuff)
Huh?
Aw okay
You can see it cycle through on the client when I run
It sets it correctly for a moment, then decides 'nah, that's too easy' and fekkin' changes its mind..
Apologies for the frustration..
Would love for @zealous moth to explain what he meant exactly, he seems to know what's up :l
Babysitting. No computer around :(
Any ideas I can try based on what you've seen at all?
Do you have multiple of these cameras?
No, just one.
Hence getting 0 in that array should get the only one present in level
Can you try putting a string here and see how many times it executes?
If it executes more than once, maybe its picking up on some camera you dont want it to (Tho Ik you said you only have one, just to make sure)
Then I think its picking up on another camera
No, that's the loop to check for player controllers
It's not looping through cameras
Unless I'm missing something
No, Im not familiar with loops, you might be right, its just a thought
Getting all actors of the camera class isn't on a loop
It's getting all instances of player controller
Which I'm guessing is right at it printing two? Since there's two players spawned in?
are you sure you really want to do exactly this? there are basically 0 real life circumstances where it seems like a good idea to force-update a camera position from the server to clients. what are you really trying to achieve?
I'm just wanting all players that spawn in to have the same camera view
How can I achieve it otherwise? Can't find any solutions anywhere π
but... why?
well how does the server calculate where the camera goes, very generally (I haven't back-read)
Because that's how my game is intending to work... This camera view needs to be fixed and not parented to the player.
Multiplayer replicated, one top-down view.
That's all I'm tryin' to do
like Gauntlet?
Yep, looks right.
Never played it, but yeah, any multiplayer game with just one camera...
take the code that the "server" uses to calculate where the camera goes, and run it on every client instead?
Alrighty... How do I do that?
Because that's pretty much exactly what I'm trying to do?
Do you guys know how to destroy widgets btw (To avoid memory leak)? (Please ping on reply β€οΈ )
remove from parent
Remove from parent should destroy it no?
Or at least garbage collection will if it's no longer attached.
Yes and no. The GC will destroy it.
^
You have to also clear references to it if you have any.
Hey Exi, do you have any idea how to fix my issue at all?
Hojo rolled up seeming to know what's up but hasn't followed through. All I'm looking to do is run a multiplayer game with one fixed overhead camera view, just like street fighter, say. Would very much appreciate any input and advice @surreal peak
The ViewTarget stuff?
Sorry Hojo, didn't mean any disrespect there. That sounded way too passive aggressive
Think I'm just frustrated with this.
Mean no disrespect brother, I'm grateful for your input β€οΈ
Yes, that's what I'm talking about Exi
One camera. Multiple players.
Is the camera in the scene?
Currently the camera is a separate Blueprint actor.
Hovering above the scene. The only way I could think to do it is by setting view target.
This works perfectly on the Server, but not on Clients.
Yeah, set the ViewTarget in BeginPlay of the level, or BeginPlay of the PlayerController, limited to the owning client.
And turn off the AutoManageCamera stuff in the PlayerController settings
The stuff you posted at the start, for what i saw, is total garbage :P
I have no idea how replication works, I'm just now trying to figure it out. Could you please direct me on how you'd do it then? On the Level BP? Wouldn't that cause issues when it comes to dying/respawning?
the camera (your camera blueprint actor) should know how to position itself, e.g. by calculating the average position of your players or whatever you're doing. there is no replication involved in this
That's why you turn off autoManageCamera shizzle in the PC
I can't see any auto manage camera options in the class defaults?
Could also be on the camera manager
How would you achieve what I'm trying to, Hojo?
(player1.position + player2.position) / 2
I'm not calculating anything @true yew all I want is just to have one view for multiple players. Default view seems to set based on the character having a camera component, and if it doesn't have one, it'll just snap the view to the actor's location. If there's another way to set the the default on this I'd love to know
bAutoManageActiveCameraTarget
well back up a bit. what "sets" the view you want to have? is it hard-coded into your level? is there code on your server that runs to set the camera position?
That's the boolean
I'm using a default 3rd person template? Whatever sets the view by default. I don't know? It uses a camera component if the player BP has one
Turn that boolean off in your PlayerController and it will stop automatically giving the pawn the camera view
Then you can just set the ViewTarget in the levelBP or on BeginPlay of the PlayerController itself, limited to IsLocalPlayerController
i'm trying to figure out how to ask this. this isn't supposed to be a trick question or anything. what causes your camera to be 100 feet high up in the air and pointing downward? did you place it by hand, does code move it there, what?
ok, if the camera doesn't have to move, you put it there, you just need everyone to use it - listen to eXi
Exi, having done this now it worked. Thank you x1,000,000. You are a legend. Thank you so much.
[I am still kind of confused as to why exactly. Why did it continually override? I'm not complaining I just want to try to further my understanding]
The PC and the PlayerCameraManager usually take care of the ViewTarget. Which is an Actor. Camera components only offset the view. If that boolean is true, then the PC will set the ViewTarget to the possessed pawn/character. And what you did earlier with BeginPlay and rpcs and what not is just doomed. You can't just hope for all players to be connected at the same time.
Man, i hate typing on phones sometimes..
Anyway, glad it helped. I'm off now, catching some sleep.
Thanks Exi, appreciate it
Is there a way to keep the physics volumes visible during gameplay?
Can an actor know what level stream its on? I could manually do this but it would be a pain. I just want an actor to do a check to see what level stream its on, and then return that value.
Any Eye Deer why a box collision would not trigger the first time you enter it? Player walks up to a chair, it allows them then to sit, but just not working the first time I enter the space for sitting in the chair
Hey everyone, so for some reason, the branch in the screenie always outputs already hit for some reason.
Im trying to get around on component begin overlap getting triggered multiple times as my mesh overlaps a players mesh, if you have any other solutions for this, feel free to suggest (The entire thing is inside of a bullet/projectile blueprint, so I always want the bullet to only run the code after the branch once for each actor it overlaps, the reason to that I dont just destroy it first time the code runs is that I want the bullet to be able to hit multiple targets before it gets destroyed)
Im going to bed now and will be reviewing any responses tomorrow, so please ping me if you have any ideas/knowledge about this β€οΈ
and sometimes it ignores the rest of the event for sitting IE stopping character movment
Why is something as simple as sitting in a dang chair being so complicated.
@fathom portal I don't see it for physics volume.
Hmm could it be that its a problem with the collisions between static and skeletal meshes?
Its setup so the chair is not part of the BP, its just a blank sit down location BP so anywhere I drop it the player can sit. Since Static and Skeletal meshes do not like each other, Should I just add the mesh to the BP and just change the mesh based on the situation in the map?
@true valve have you tried the show collision command?
Content guide to creating and setting up collision geometry.
And I tried the command for myself, and figured out why my collisions were only running when walking right.... Because my right flipbook was apparently set to collisions every frame!
Here is my BP for changing the color via sliders on a material. I am storing the values however when trying to change the same material on another pawn it wont work, the rgb values transfer over fine, its the Set vector param that is not working.
what's the error?
my guess is that you're still targeting the first pawn
They share the same material tho?
no such thing as sharing
Well I mean both are set to the same material
I'm not changing anything about the pawn but more so on the material side.
what's the code for the get player controller?
I don't think I reference the pc
only the game instance
Wait
Yeah no I don't
I'm just storing the rgb info to the GI
Which works fine
what I meant was what is the code above with the player controller
well if that widget is where you change colors
you're only changing colors for player 0
so the first player
Yes
Thats correct, thats why I'm storing the info in the game instance
So I can pull it later for the real character
well there's your answer for why it doesn't work
It's not supposed to change the real characters color until its created
hence why I pull the stored rgb info out of the GI
I mean you asked about why it doesn't color the second pawn
and try to set vector param
I understand what you're trying to do
Okay
it's not really relevant for what I'm saying is wrong
Is there a better way to go about this?
This was the only way I could think to do it
where do you hook up your pawns
Well I have a color changing level
there are of course better ways to do this
Huh yeah, always a better way xD
but honestly at your level it's going to be hard to suggest something that I would be able to give to you to build
color changing level is for what I call displayball
like a lot of this is complex behavior
so of course it's not easy to get right
anyway show me your pawn setup
maybe I can at least make the second pawn work out
This is the fake pawn
essentially just for show
the real pawn
Has a lot going on
Movement and timers
So it can't be used to display color changing
The gamemode info for the display ball
Let's go back to this
Just doesn't change the color on the 2nd pawn
@twilit lily
Okay
so you can't change the 2nd pawn
what is the first pawn? your display ball?
where is this logic setup?
The sliders?
They are what changes the first values
Thats one example
which ties into
https://discordapp.com/channels/187217643009212416/221798862938046464/687814202215235615
this image is why your pawn isn't being colored
you're casting to display ball instead of ball
I see
so your setup is
you do the color change, click ok, then spawn the level expecting the color to be on the pawn
Did you assign the dynamic material instance to a material slot on the ball on beginplay or in the construction script?
probably the ball pawn doesn't have a dynamic material instance
not sure if that works
Mat BGIInst is a copy of the dynamic instance from display ball
like if it's saved
where is your ball pawn blueprint?
Ok
and THEN set the color by the stored values
might not work in construction script but give it a go
yea
construction script is really just if you want to do something with the actor at editor time
oh
erm
Still not working
Im going to triple check the rgb values with print
Yup they are stored correctly
are you sure the parameter is called Color?
100%
It works with my other pawn
All im doing is storing those values that get set and sending them to this pawn
put a breakpoint and see if those values are actually saved
breakpoint? uh let me try, never used it before
So its not values
This doesn't even work
Which should just be red
I did confirm that the Ball is taking this mat by manually changing it to a different color
Here is the Material
Good idea
ill try it
Awesome
Its working now
Got it all plugged in
Man those small things can really get ya xD
@twilit lily so the set material is something you'll need to do every time you want the material values committed
nice to know
@twilit lily btw if your mesh only has 1 occurence of that parameter name amongst all of the materials you could also not use a material instance dynamic
I see
this is the construction script
Whats the big dif between a construction script and begin play?
What actually happens when an Actor is loaded or spawned, and eventually dies.
it's a bit more complex than this but that's the gist
Is there a built in way to draw things in the viewport of blueprint editor on a generic and shared basis?
Say I have an interface that defines some stuff that I'd like to visually show in blueprint editor's viewport. Is there some way to add in some lines based on a selectable view or something? -- as in the show menu or broadly
not entire sure how you would draw something like this. for sure there's nothing selectable. there might be a console command, but it also kind of sounds like it could be solved with a print string?
how do you convert world points and to points relative to an actor including rotation?
Yeah mostly curious because i'd like to avoid a base class implication for only needing to write some debug lines for this interface
how do i hook this up trying to stop the camera from moving on my thirdperson player character
nvm did it but still moves when i move my character
Hey there, im trying to construct an object from a class (Actor). I am calling this in my blueprint which is a child of Actor Component.
However, i'm getting an error saying 'Cannot construct objects of type ...'
Does someone maybe know why this is happening?
@gloomy nexus I'm not an expert, but I don't believe you can construct objects deriving from UObject starting from Actor and beyond. You should be able to use the SpawnActorFromClass node instead though.
Thanks for your reply, going to try that π
How would I make my character slide? this is what I came up with but my character gets stuck in increasing sloped
slopes
I'm trying to make a fairly simple enemy behavior tree. Right now, when it starts, it gets all of the "exit" actors and finds a path to them then tells the pawn to move towards the nearest one. Unfortunately if the path is still completely obstructed it still thinks it's a valid path π€
Hey, what would be the best way to cut a grid mesh to a circle or some other amorph shape insead of the square/rectangle it is at the start?
Hi all, I'm using an HMD and need to get the GetDotProductTo of my Camera component and an Object referenced in my scene. The node only accepts actors, does anyone know how i could get the 'self' to update with the camera ie HMD movement?
@fathom spindle .... why don't you just use vectors for the dot product?
I'm not sure if HMD has the same setup, but you can try with SetControlRotation
i thought there was a difference between regular dotproduct and getDotProductTo
i guess none!
thanks π
Hi @odd ember the regular dotproduct doesn't seem to work for me, am i doing something wrong?
just prints as zero
if the dot product is 0 then one of your vectors is 0
use breakpoints to debug
also!
keep in mind if you're looking for directional overlap with the dot product you will need to normalize vectors
ah ok so i should offset my player location a little and normalize both incoming vectors?
well it depends on what you're looking to do
the dot product is literally just a product of both vectors multiplied by each other
so if one vector is 0, the dot product is 0
im looking to get a value for how much my HMD is looking at this actor
that's directional overlap
so yes, normalized vectors
normalizing a vector generally means you get a direction instead of a distance
ive done that and now it does update with the HMD view rotation but the values are strange. -0.05 when its facing dead on, -0.1 when its 90 degrees away
ah it's not that bad
no need
well most likely no need
normalized dot product spans a range from 1..-1
1 is dead on, -1 is the view directly opposite
0 is at either 90 deg angle
is it this tolerance float?
the tolerance isn't something you need to touch
0 is at either 90 deg angle
@odd ember thats what i was expecting but im getting these strange small values
breakpoint and cehck the vectors
well actually
for the camera
use the forward vector instead of normalizing location
for the secondary vector, use (camera.location - otheractor.location).normalized
that's going to give you the direction directly from the camera to the other actor
versus where the camera is pointing
well try it
gives -40 facing, zero at 90degrees in x and 180/-180 in y
you normalized one before subtracting
I wrote it previously my dude
What's the difference between UMaterialInstance and UMaterialInstanceDynamic?
@cinder relic don't think you're in the right channel, but dynamic instances can be changed on the fly and reapplied. instances are just cheaper versions of actual materials
(with baked in data ranges)
So for some reason, the branch in the screenie always outputs already hit for some reason.
Im trying to get around on component begin overlap getting triggered multiple times as my mesh overlaps a players mesh, so Im trying to make it so that the branch checks if the actor its overlapping has already been overlapped once, if it has been overlapped, I dont want it to do anything, if it hasn't, I want the code after the branch to continue to run (The entire thing is inside of a bullet/projectile blueprint, so I always want the bullet to only run the code after the branch once for each actor it overlaps, and why I dont just destroy it first time the code runs is that I want the bullet to be able to hit multiple targets before it gets destroyed, so I were planning to set up some sort of a health system for the bullet that would then run directly after the code in the screenie to have the bullet get destroyed after that it have hit enough obstacles to fully drain its health)
Is this what Event Hit is for? I tried using a Event hit event node earlier, but I didnt get it to pick up on anything, despite having "Genererate event hits" set to true. Physics for the bullet is however disabled (As I simply dont need that), is event hit only for physics sims or should I be able to use it for stuff like this? Or is there another event node for this (A event node that will only trigger once per overlap for each actor it overlaps with)?
(Please ping on reply β€οΈ )
I dont event get why my code doesnt work in the first place :l I feel like it should
I'm realising my character has no velocity... :/
When I Print Player Character's velocity in debug mode all X Y and Z stay at 0.
Am I missing something ?
Character Movement ?
yes
The generic Get Velocity only works for Primitive Components
@trim matrix ....it looks like you're printing velocity 1 time? Are you getting it on tick or something?
@trim matrix are you printing it on Begin Play?
looks like it's being printed once, on what I'm assuming is begin play
so yes, it being 0 makes sense
Oh yes it's on BeginPlay
Begin Play is executed only once
yeah it's not going to show anything other than 0 since it's 0 at beginplay
so you have been showing the initial value for 1000 seconds
and the initial value is obviously 0
@spark robin the best way to do that is to use a boolean flag for the overlap as a gate
on the initial overlap you set it
then you use it to prevent any reaction to any other overlap
finally on End Overlap you set it to false so the next overlap can be detected
another way to tackle this is to use a DoOnce after the first overlap and reset it only on End Overlap
Ok, it displays the Velocity but according to World axis, so there's minuses values.
vector length
velocity -> vector length -> print
if you want to ignore Z velocities (ie falling/jumping), do vectorlengthXY instead
@trim matrix in general, all physics quantities are in world coordinates
you can transform them in local space if needed
https://docs.unrealengine.com/en-US/BlueprintAPI/Math/Transform/InverseTransformDirection/index.html
Inverse Transform Direction
Feed in the the world transform of your character and the velocity vector
with that you have your velocity in local space
I'm using this value to affect something else in fact.
@atomic salmon Oh, I didnt know about End overlap! Is there any chance it might bug tho? Im thinking if it overlaps 2 actors at once
I will try it non the less, thanks β¨
@spark robin if you want to detect a specific actor to Begin or End Overlap, you need to cast Other Actor to the actor you want to detect
Other Actor is one of the outputs of the Overlap events
Say you have a BP_Sphere and a BP_Cube overlapping a trigger volume. If you want to detect only the BP_Sphere at a given time, just cast Other Actor to BP_Sphere. In this case the cast will fail if BP_Cube overlaps the trigger and you only do something if the sphere has overlapped.
I would like to make the Velocity equal to another Value if that makes sense...
For example, my Max Velocity is 900, and I would like to make it so that it equals to the maximum of another Speed value at 14.
I tried to Divide the Velocity by about 90 but it messes up things when I move too fast.
@trim matrix what exactly are you trying to do? maybe MapRange can help?
I try to make 2 ranges following one another simply said.
yeah maprange or divide value by max value to get alphas
Oh I forgot about Alphas.
Maybe that's the solution.
can also use that for a lerp
Ok so it seems to work well, but I have to Interpolate because it still create jerks.
Certainy because the Velocity goes too fast.
This is with Divided but I have the same result with Map Range Clamped.
Is there a way to override PostEditMove in blueprint?
@trim matrix possibly because you are directly influencing velocity instead of using AddMovementInput but not sure
This is how it's calculated.
Should I use Finterp To somewhere?
Or at least where's the best place to bind an event? Don't really want to rebind it on construction script π
but it's for an editor function
so π€·
@trim matrix I don't think I should use the movement's Axis and such.
So I tried with my joystick's axis, it's the same, I have the jerks between speed change.
Can actors see what stream / map they are on?
I can manually get the streaming level but I want to know if an actor can see what stream its on without having to manually type it in
@trim matrix use movement states and transition between them instead of forcing the velocity
I don't really understand what you mean. I obviously can't use fixed variables for what I aim for.
Like Max Walk Speed itself.
Movement states dictate limits. I am not sure what you are trying to do but based on your bp and vid you want to shift your speed. No? States do that for you.
I'm using velocity to influence other values.
It's the same when I used joysticks axis as I said (which means a simple range from 0 to 1)
So the problem doesn't come from Velocity itself I suppose.
Anyone have any tips for using the search box in Blueprints? The documentation at https://docs.unrealengine.com/en-US/Engine/Blueprints/Search/index.html is pretty sparse and doesn't cover, for example, all the syntax I get when I do a normal search and press "Find in all Blueprints":
- There are names in brackets, e.g.
"(MyBlueprint)" - There are
=+signs, e.g.MemberName=+"Something" - You seem to be able to search by
MemberGuidand other properties of, say, aVariableReferencebut not others?
Ideally I'd like to search for all BPs that have been deprecated so that I can get a picture of how much work there is to do replacing them across the whole project.
Also, is there any way to export the search results as plain text so that I can keep track of them outside the editor (like on a todo list etc.)?
Getting the most out of searching in Blueprints, from indexing all Blueprints to advanced search syntax
What's the "OOP paradigm"? I just wanted certain Utility blue prints to be active if their given stream was active. I can do it manually via the stream name but I was hoping actors might be able to know the stream they reside on.
For convenience mostly
it's a violation of how the system architecture works
like you should query actors of a level through the level itself
I gotcha
@tulip iris you can do it but not with Blueprints afaik. Basically you need to get the bounds of all streaming levels and check within which one your actor is.
yeah blueprints as well do not allow access to ULevel which holds the level actor list
Alrighty