#blueprint
402296 messages ยท Page 835 of 403
It is clear who is toxic among us imo ๐
bye, felicia
You're not much better, expecting hand holding for your problems for free
@hollow inlet As a fair warning. Being sour in public is really unbecoming. Even people who are willing to try to help you more are much more likely to avoid helping you in the future when you act like this. This is a public forum, you're free to ignore the first person that responds to you if you don't like their answer and simply ask again.
He's not wrong that some people here are being overly snarky and sarcastic with their "help"... but that's a matter for the moderators to figure out I think..
Honest question, was my asnwer snarky?
no
So.. if you wanted your GameInstance to be able to Bind to an event from a GameMode... how would one go about that? The game instance is generated before the gamemode, so at the moment, its kinda missing it... any thoughts?
If it is percieved as snarky, surely i can... add a smiley to it ?
Have your GameState tell the GameInstance to do it's finding through an event.
I think it's fair to expect an answer without a lengthy explanation
90% of the askers simply wants thr answer anyway
Sure, expecting free help to be elaborate and handholdy is not right
I've had to drop gamestate because its lost when the level changes...
And if not, the real explanation can be way above their current skill level, so explaining it could gain very little...
Doesn't really matter in the end. You can't control the way other people are in public, only yourself. ๐คทโโ๏ธ
It doesn't mean the response to it should be similarly unfair
this is the way
Would that be in the form of a direct function call though... e.g. GameState say "Ok, now do those late bindings you couldn't do before"... then I run that function on GameInstance to do the bindings etc..
Sure. All you need is an event in your GameInstance. Have your GameState's beginplay call it.
could you maybe give some context for what you're intending to do?
Can pass itself through if you want to, or get it globally, doesn't so much better.
Thats what I thought... but I was trying to avoid that direct calls and use the bindings/event dispatchers instead... if I need to add a direct function call to say "Do the late bindings" I may as well just have the thing call a function to do the original task etc... equally what I was trying to avoid... wanted to avoid the number of "fingers in pies" so to speak..
it can't because it tries to do this too earlier before the game mode is ready...
(that would have been my preferred approach tho)
the game mode can register itself onto the game instance
Sorry, i missread it ! Reversed yes
How would I go about that please?
Are you trying to avoid casting or?
on game mode begin play, get game instance and have something like a Register(GameMode) function
But again thats a direct function call isn't it?
Thanks a lot for this insight, I'll try this asap
Cause honestly, there's no need to avoid casting in this case. It's code classes. Cast to them all. Your memory footprint isn't going to do anything.
yes but it's to a manager class
It's just what i needed ๐
..but then, potentially anything else could hit that same function...
I had fun with it. ๐ I was doing what you're doing in reverse, made a reversal spell.
sure you could register multiple game modes in this way. but if you only need to register one, no problem
but the same process is used when e.g. registering interactions for the player, or registering AI pawns to an AI director
My mouse isn't updating while i'm moving for some reason, causing my pointer to lag behind
It wasn't so much about avoiding the casting... just getting around the order of events again...
I don't actually know what the pattern is called but I'm pretty sure it is a pattern
Perhaps if I summarise what it is I'm trying to achieve it might help...
just maybe not GoF
What code are you using for this?
always helpful
well there is #legacy-physics
GameInstance is holding a data item that needs to be persisted across level changes
The main menu has three "modes" of play, each uses a unique GameMode.
When the level is complete for each GameMode I want to report back that the level is complete and update the data item in the GameInstance.
Each GameMode has a "PlayModeCompleted" event dispatcher.
I wanted to fire that and then have the GameInstance respond to it accordingly. In this specific case, it effectively "unlocks" the next mode of play (this is for an experiment where the participant works through a series of tests).
Ordinarily I would set a reference , create the binding, and all good... but because the GameInstance is created first, the GameMode doesn't quite existing yet, and thus it doesn't create the binding. If I add a Delay node (shudder), I can create the binding, or at least, it looks like it does, no casting errors, print node indicates the binding was complete, but it still doesn't fire - which leads me to believe it didn't quite create it in time.
I would prefer that rather than having direct calls to functions in the GameInstance, it just listened for updates, and then responded etc.
I looked at using GameState, but because that's lost at the end of each level change, I can't persist the data item across all levels.
Instead of doing the world location of the mouse here. Use a LinePlaneIntersection(Origin&Normal). You're looking for a point on a plane that is the turret's location, facing UpVector in world.
How do make the capsule for 1st person view to a different capsule height from the 3rd person capsule in multiplayer?
the correct way of doing it is registering game modes to the game instance
"correct"
@weak zealot
the character in the first person must have a different capsule height
Yeah I think I'd still use a function on the game instance and let the game mode say "hey I'm here!"
exactly
I did wonder about that... I was going to have it sit there effectively "waiting" but it still then needs to know when its been created....
polling would imply you check every frame
beginning to feel like my approach with the event dispatcher stuff isn't the right way... and I'm really struggling with sooooo many things all just being public and having their claws into everything else... I get that "it works so move on" etc... but it just feels I dunno... a bit wrong to have so many things able to talk to sooo many other things...
Yeah, that'd be a bit heavy I guess... although I suppose it would be "ready" fairly quickly...
well the point isn't even the heaviness, it's just that it's not as elegant as the self registration
polling handles exactly 1 case, whereas self registration handles a handful of cases at least
So if I do that though, with the Register(GameMode) approach as @odd ember suggested, e.g. a direction function call... is there still actually any benefit over not just making the call directly to the GameInstance from the object in the first place that needed to update the value? e.g. why not just let everything talk to it in that manner?
Does it matter then that my 3 GameModes are all inerhited from a base gamemode (my own, not the default) and its only that one that has the event dispatcher I planned to fire (done via the derived GameModes), e.g I'd only really be registering one
you can but generally you only want to couple where it is relevant to couple. so game instance <> game mode makes sense. and game mode <> actor makes sense in terms of hierarchy. but if a level can have multiple game modes, then you may have issues understanding under which game mode context you need a certain actor to register
I think this is part of my problem, I've been trying to make everything not coupled... and then having a massive BALL ACHE in trying to achieve this...I should add... with a couple of minor exceptions (widgets created by playercontroller etc)
so I don't know the full context of what you're doing
but if it wasn't game mode picking up on those actors, it should probably be another actor or object that you wrap as a "globals" or "savegame" object
quotation marks because it doesn't have to be derived from any such class
Trying this out, gimme a moment
You'll probably hate me when I've wasted this much of your time for the "one" variable that is a structure holding effectively which "mode of play" is unlocked... I figured GameState initially, then moved to GameInstance when I realised the persistence issue... I avoided the SaveGame because I figured it only matters each time the game is run, e.g. if the game is run a second time, the whole thing is wiped and starts afresh anyway (new participant etc). So I thought just holding the progress through the modes of play in the GameInstance would work.
I'll give the Register(GameMode) approach a whirl.. I know it'll work as the direct function call thing will obviously avoid the execution order/timing issue
Thanks @odd ember / @maiden wadi / @dawn gazelle - appreciate your replies and especially your time ๐
The issue persists. Also i haven't used this node, not sure what it's doing exactly, can't debug it right away
Also it looks like i'm getting some gimble lock too ๐ฎโ๐จ
@maiden wadi It worked!!! It feels like magic after just following your instructions ๐
Love that function. I use it a lot.
I am just curious about getting the lapsed time
I did this
But I don't really know if it's a good practice to do this
Nah. Ditch the float. Just promote the return variable on the timer and use the handle to get elapsed time.
And set the timer to the length you want it to play.
Or just use tick and it's deltatime to count it, either way, but don't use small numbered timers like that.
Thank you ๐
Having an issue with a texturerendertarget2D. The scenecapturecomponent2D is attached to my BP character and is coded in the character to only show the mesh component. The issue that I'm having is that the background is still blue and I require it to be translucent. I've messed around with the alpha but it doesn't appear to effect in. If anyone has any solutions please let me know.
how do i reset ragdoll when i respawn in through a checkpoint
right now, when i respawn (teleport to the checkpoint) it doesnt teleport me
How can you make your camera maintain the same distance when you rotate it in third person view?
Is there a way to make this color transition smooth? Other than doing some animation bc I might want to take the current state into account to make it more procedural.
I think some subroutine that waits and repeats until the color is lerped, to avoid the event tick, but idk how that is done in unreal
Just use the tick
Or an animation
Or a timeline
Depending on which class this is in
real stupid question but im not used to UE5, when making a widget how do i go to designer mode seems locked in graph mode
I found this: "You create a trigger for which to call the Timer Event, and you set it to update by a loop which uses DeltaTime. But because the Timer Event itself will only be ran once you have to make sure that the function you are calling can pause and clear the timer itself!"
I think that's ok?
https://forums.unrealengine.com/t/what-is-the-equivalent-of-coroutines-in-ue4/286754/5
Old Question but I thought I would provide an approach I use that has the same effect. If blueprinting, create a custom event in the Event Graph. Perform whatever scripting you want and then add a delay node. This delay node acts like a co-routine, as it won't prevent the rest of the event graph from processing. Co-routines are something I do mi...
hey all. i've got some expierence with setting up vehicles in UE4 but wanted to try and use Chaos. but it doesn't seem to like me. the car falls down and the wheels just flop in place as if it was simulated. am i missing something here?
Yeah thats reasonable, but if the timer is to infrequent, it will be very visible
And the gains vs tick is... questionable?
Timeline would work as a 'limited duration' tick, with curves to play with for more refined behaviour
I found another reply in the link above:
"For those who is still looking.
Here is the most effective and lightweight solution how to achieve a similar result like it is in Unityโs coroutines (no timers, no delay nodes, no timelines, not inside tick with a bunch of checks). In Unreal the same functionality is easily achieved by using Latent Actions.
In order to make it happen and to use it in your blueprints, you will need to write a code in C++[...]"
Yeah, the problem is I might control some property like scale with some other action, and when hovering I might want to inccrease it even more, so unless I can overlay animations I might prefer it
Wont argue over latent, but I'm not seeing much of a gain for something like this..
A few lerps on a relatively limited tick, is not something id worry about
Thank you!, I'll stay event tick in that case then, at least till I learn how or I see I need other method
Animated stuff needs to be updated close to every frame for it to be smooth, not much getting around that at the end of the day
If it were heavy calculations and native (c++ tick) wasnt enough to reduce the immediate cost, then id probably consider a co-routine for it
Atleast thats my take on it.
This is super weird. Look at this. I created my own collision channel named grass so whatever the box hits that has the collision grass should get its position (0, 0, 0)
It gets it, but as soon as i change the collision channel in box trace it will set the position
Good to know, I'm coming from unity and C++ is hard and scary, I have to see how blueprints perform, hopefully not too diferent, maybe better? ๐
when i set it to visibility instead of grass this happens
Depends on what you're doing ^^ i got an 80% gain from converting identical code from bp to c++
Blueprints offer way faster iteration tho, so atleast for now id just stick with that. Can always convert it later :)
How is the grass spawned
Whatever your base item class is. If you intend on doing this same thing with all items, then you probably want to use a class that is a parent to your "weapon" class.
I dont have it like that
time to refactor then
not again
๐
I just spawn a lot of lines and wherever it hits it will spawn grass ๐
If you don't do it now, you're going to be kicking yourself later that you have to refactor even more.
Default sword is the parent
Ok, and what is the parent of Default Sword?
that's not too bad. just create a parent class called weapon, and let the parent class of weapon be item
So, make an "Item" actor class. It should contain any variables that are common to all items.
almost as if there's some sort of logic to this
because Higher rarities or tiers would just be a multible for those values
I think
Yeah i want to remove the grass where i want to spawn the stones
no harm in having an enum for rarity if you need it
but don't let me dictate how you want to do things
Then you may want to create a subclass, "Equipment" - basically any items you could "equip".
This should contain variables that are relating to being able to be equipped... LIke an enumerator for the equipment slot it would go into... Durability/Max Durability.
lol I dont know how to do things so that part of the problem
Then you make a subclass of that "Weapon" - this can have variables relating to damage.. Like damage amount, damage type, etc.
Sounds like you should try and spawn the stones initially instead of having to spawn things you dont want
Then finally, you may have a "Base Sword" class.
that is kinda what I have already
I have dynamic values in the item database
and stock in the actor itself
or static I should say
Yeah but if i do that i can spawn grass next to it and bc the pivot point of the grass is in middle some of the grass from the mesh will end up glitching through the stone
so I can pull into inventory and reconstruct the item basically when I use it
Spawn stones first
Only spawn grass if the trace does not hit stone
Yeah but my question still remains like what tha hell did even happen. I just changed the channel it didnt work. You have any clue?
i cant use material cuz i am not working with landscapes
you could use physics material
just a thought
To spawn the grass?
to determine where grass can be spawned
try it?
sure
Yeah but like this is what happens
its still outside but its still inside
so i cant place the grass after. I have to place the grass first
just make your traces larger?
1 trace per grass instance
For what?
I am already doing that with spawning of the grass
Do you mean for the rocks?
if you spawn the rocks first, then trace with traces that are slightly larger than each grass instance, you'll get grass that is neatly filtered around the edges of the rocks
AI's currently in development. There's a lot that I actually need to learn here, though
Like this
green means spawn red means ignore
which is the opposite of the default unreal coloring ๐
Oh yeah that was 100% on purpose haha
But like if it spawns here becuase the pivot point is in the middle some of the grass will glitch trough the stone
the point is if the trace is slightly larger (for a single grass instance), then it simply won't place it there
What do you mean by slightly larger?
How can a trace have a size?
Oh you mean to spawn the grass with a box trace or capsule not line trace
yes
the alternative is to spawn a sphere trace at the end of the line trace to check if anything is blocking it
but the same principle applies
yeah smart, that way i wont spawn unnecessary instances
Doe's anyone know a free Voice Chat Plugin?
Wasn't there one built in with EOS in 4.27?
I don't know
At the very least, you want to have a base item class that all "item" type objects in your game inherit from that contains some basic data about said item and will house basic functionality of your items (such as your overlap showing the display name of the item).
You may not need to have a class for every single sword in your game if you're intending to use a datatable for item management, but at most then you should have only the "base sword" which is parented to "base item" - then when you're spawning a sword in, you already have the "base sword" class to work with and just populate it's values/change it's appearance based on the data in the data table for the actual item you're trying to spawn. There is no sense in creating a bunch of "sword" subclasses if you have a data table that contains all the data about your swords. If your data table doesn't contain all the data for your swords or can't, then you may want to rethink how you're handling them otherwise you're going to have to be setting values in two different places.
Seems to be for C++
Further to this, making subclasses means you don't have to keep reprogramming similar functionality into every "copy" of an item that exists as its own class.
And if that functionality needs to change, well, now you only need to change it in one place instead of 500.
Ughh, i've googled everywhere, can't find a solution to this weird problem. seems other's are having the same problem i've found after searching "mouse lag" here. I have my object rotating towards my mouse pointer, but whenever i move the object seems to push away in the opposite direction i'm moving, almost like it's being effected by force. I plugged the cord of my ConvertMouseLocationToWorldSpace node and whenever i'm moving it stops updating properly
show code?
Someone else here had me calculate the mouse position differently, but it had the same issue
this seems correct
how does the lag manifest?
is it the character's rotation that lags? or the cursor itself?
i'd say less than a second
I'll send a video
I don't see any lag in the video?
Look at the "barrel" of my makeshift tank
That's what i meant by lag, it should be pointing directly at my mouse pointer
"Lagging behind" suits what i mean better
Im not able to get the widget in the new Item class I made, I tried using it as a variable but that also wont connect
@dawn gazelle
you mean when it moves?
Yup
You need the widget component to plug into the "Get User Widget Object"
There isn't any I can see
try disabling tick while moving
Wont that just completely stop tracking the barrel? (If you're saying Event Tick
you're probably asking in the wrong channel. #ue4-general or #fab might be able to help you out
yeah but How are you pulling that into the blueprint
As a variable? bc that wont connect
it will but the tracking is correct
It is a component in your blueprint yea?
Hmm.. yeah but that means you can't aim and move at the same time
Not exactly what i'm looking for
oh im trying to put it in the base Items class
im dumb
for the 3th time today
(which it probably should be in the base item class)
between the two pieces of code you've shown only one of them affects the turret rotation
my guess is if you move the tank while moving the mouse it's OK
I fix
This makes it when I use other items that are not weapon it will also work
I don't quite understand this, if i turn off Event Tick while i'm moving, I turn off what's rotating the barrel.. so it'd be locked into position while you're moving, snapping back when you aren't
yep, but basically you're not a fan of the lag, so you can test if it lags if you move the mouse AND move the tank. if there is no issue then (which I suspect), then you probably want to lock the rotation as long as there is no mouse delta
disabling tick while moving would be a test to see if it fixes the lag at all (which again, it should)
moving the mouse and tank at the same time presents the same problem
can you test if you move the mouse around the tank itself if the turret actually follows the mouse at that point?
Moving or still?
both moving
When it's not moving, it's fine, when it is, it isn't.. if that's what you're asking. (Moving the pointer around the tank a few times)
Not sure if i understood what you were asking 100%
Another test: lock the camera in place, let the tank move and see if it's better. IMO you probably have things updating in the wrong order.
I'm asking if the turret follows the mouse if the tank is moving, even if the mouse has moved over to the other side of the tank
You need to have:
- Tank move
- Camera move
- Get the current mouse world position with new camera
- Turret moves
I'm moving everything at once really, since it's just a player object
Yeah, but you aren't
They are updating in some order and if that order is wrong, bad things happen
If you work out where the mouse pointer is before the camera moves, you will get the wrong data
(to my knowledge)
How could i change this order? manually code it in?
in which class is the mouse tick event happening?
CE is right that you should try isolating things. Isolate each of those steps above and see which combinations of th break. Can you move and point without camera. Can you pan camera and point without moving
That will show you which bit is happening at the wrong time
So strip it back and take baby steps and you'll get there :)
Exactly. On some level you already are, you're just not aware of it. You can't do all those steps at once, they have to be in some order. The trick is working out what order they are in and why
you can try and do print statements to see if there is a consistent order to your events in relation to the event tick as well
ideally you would get a consistent order of either tick first, or input event first
Inputs normally happen very early on
it's a question of how far along the tick update I suppose. I don't know, that's why I would test it to be sure
I removed my camera from my player object, then just put it in the scene.. because i wasn't sure how to lock it into place since everything in the player object is moved (Targeting Self:).. and it's further broken. Not sure why
I don't see any ghosting anymore
Yeah, seems that issue solved itself
But it's really weird now
It seems offset somehow
Can you draw a debug sphere or something for where the tank thinks it's pointing at in world space?
Pushed it down on the z axis because it was almost inside the camera
Oh, I think you might not be converting from screen space to world space?
This is a long shot... but I figured it is worth asking
Anybody know if a BP that has animation timeline curves for moving elements is more/less performant than a skeletal mesh object with animations and anim bps?
i am trying to make an open chest object, but there are a few ways to do this
animations seems a bit overkill unless I am wanting to do somethign crazy with it.... So the more likely and easier option (from what I can tell) is the BP + timeline curves
however, I dont know if that is better or worse than a skeletal mesh that has an ANIM BP
my money is on the timeline if you just want to open and close a lid
rigging and animating a chest with an anim bp seems like overkill
right?
i mean if i wanted some scale or something like that.... yeah
but I dont, so my thoughts are to go with the timeline curve. Just wasnt sure if that was performant.
i mean you can do scale on a timeline as well, at the end of it, a timeline is just a float over time
you can even add events if to a track if you want things to execute over time
nice
yeah, I know niagra could do the same
so... looks like im going to go with that then ๐ thanks for the answer
I am having an issue with my ball isn't bouncing properly off the walls. I tried using projectile movement and that didn't work properly. I tried using Physical materials but it doesn't work at all. does anyone know why it don't work?
timeline with alpha value float with a rotation lerp?
have you asked in #legacy-physics ?
i did and I apologize for coming here
ok
damn why is doing level designs on paper so fun
Okay
okay okay
I think I'm getting close, I thought hours ago
The speedup works wonderfully, the only issue now is that it keeps picking really odd, arbitrary directions in which to up speed.
Weirdly always veering slightly right, and going exponentially the wrong way the more I turn, doesn't matter how or where I look or what direction I walk in.
you don't want to be dividing with the direction you're moving in
remove all the rotation nonsense and just use GetActorForwardVector. multiply that onto your float, then add that to GetActorLocation and use the result to SetActorLocation
That..
is unsurprisingly elegant, I'm just stitching things together from my other node clusters atm ๐
I'll try that, cheers !
Would anyone have a good idea on how I'd go on making a push to talk system
I'm a little baffled because it needs to only stop the audio coming from the player using push to talk
Not from every player.
I tried this with no luck
Thought it'd work because the Voice Generated I think is coming from the client so then checking for push to talk and then if it is true capturing that data and sending it or if false just sending blank data
yeah
Does this logic make sense
the bool i am creating is to find out....
is usable + is used (not) then fire TRUE
after true, set isUsed to TRUE so that it cant fire again adn will fail
logic seems to work in my head, but dont know if there is a better/easier way to do it
and I tested the logic and it works, so... barring anybody saying I did it wrong ๐
When you break a for each loop with break does it signal completed
yeah it should go to the completed pin
Im trying to setup a quadtree in ue4, and so far I have it dividing continuously, but the problem is the location of each node becomes innacurate after the 1st division and im not sure why. Here is how I determine the 4 new node locations and here is the problem in action
it starts as one big grid, then when it subdivides it turns into 4 separate grids, but in this image I only enabled one of those 4 grids to make it easier to see the problem
InLocation represents the center of the previous node or "parent" node
If you're hoping if that's possible to do in C++ then #cpp would probably be the best place to ask.... If you're just looking for a blueprint solution then two easy options I can think of... GameplayTags or Enumerators. Gameplay Tags are a little easier to work with, but you have to deal with the full hierarchy of all the gameplay tags you have (see screenshot) but they can be converted to strings or used with switch nodes.. Enumerators you have to have all the options defined in an enumerator to begin with but they can be converted to their friendly name and used as a string.
How do i grab another actors location? For example I have this one actor that is always moving. I want to make this other actor move towards using IntgerControlPoint
is there anyway of doing 'ai cone of vision is less than''?
@obsidian ridgeyou could create a variable in your original actor that has the type set to actor reference, and then get the location from it. To specify the actor, make it public and select the actor of choice in your level
can anyone help with @small halo question please, Idk how to
Would i use on tick to constantly update it?
@obsidian ridge u got any ideas on how to do ai cone of vision less then?
anyone pls
best not to spam asking for help.
@wet addersomeone will answer when they know
its best to wait
if there is no answer in an hour, post the question again
no problem
super sorry
I will test this out once I get back home thank you
Has to step out since what I wanted to accomplish was not working out
np
before you go one more step
in the editor, you can select the object you want and set it in actor 1
here I grabbed actor 2, an entirely different actor and chose it inside actor 1. Now in actor 1 I am able to get the location of actor 2
In animation blue print. How can I set my mesh to disappear and reapper
set visibility
And if its two or more meshes
you would figure out the conditions needed to set the visibility, then call this function
you can plug them into one set visibility node
like here
or different ones
well this is more of switching the model for facail expression in the game
they dont have to share one set visibility node
hm
you could set the visibility of the first mesh to false and set the visibility of the second mesh to true
ill try to make an example
ok. Lets try that
@tardy flax
you need to figure out the conditions for switching
but this is how it could work
can you screenshot your blueprint
It empty
you are sure these arent in ue5?
set vis is no where found
yes
well I do havbe a event graph and it has that so let me try
couldnt you just set the size of mesh 1 to be 0,0,0 and the size of mesh 2 to be whatever it needs to be?
no because they are rigged to the same bone
Is there a way to have a bunch of reusable events?
I have a bunch of events I use often in different places:
- Multicast_Play_AnimMontage
- Multicast_Spawn_Particle
- Multicast_Play_Sound
- Client_Play_Sound
etc.
I don't want to copy and paste the same implementation in multiple places
I basically want to use them similarly like a Blueprint Function Library (use them anywhere independently), but I know events cannot be used as functions.
@odd ember Fixed my problem, and future problems by ditching the mouse pointer in its entirety and just using an object
Thanks for all the help
Well, one way would be by using a parent class to whatever blueprints you're working with? Like, if this was for an ability system, you'd make one parent "Ability" class that contains those events, then you can just use them wherever you want in any child classes. Apart from that you can't really re-use events as they are tied to the class they are being used in.
Do you mean inheritance?
Yep
Ah, unfortunately the BPs that use it differ too much to have a common parent
I was thinking... have all the events in a BP called BP_CommonEventsUtility
Then in any other BPs that need those events just spawn that BP_CommonEventsUtility and use its events
In software dev, it's like instantiating a utility class in the place you want to use it at
What do you think of this?
is there a way for an object, actor etc not effect the ai perception?
like so it doesnt block it?
doesn't AI perception have a choice of which channel it scans?
if so... just have the channel be ignored?
if i had an enemy ai, i dont want them blocking each other, will this effect them seeing the player?
I don't know. I don't use the AI perception system. I made my own instead. I'm sure you can make that happen, but given most of the AI module is made for cpp, you might have to dive into code to make it work properly
but I would check which channels the AI perception uses
I'm not 100% sure, but I think it's probably a bad idea? Like you'd need to spawn one of those actors for each player as each player would need their own so they can be set as owner in order for the player to receive any of the executed RPC events.
and see if you can change that
okay thank you for your time
BP Component is a way to have reusable code that can be slapped on any actor class
And components can be used in an interface-like way cuz from any actor ref, you can check if it has that component or not
And then call functions on it w/o casting to the actor class etc
Hmm.. yeah, actually currently I have all the events in a BPC which is attached to BPs that need that functionality
However, I have other BPCs attached to the same BP that need those events..
So I pass in the BPC_CommonEventsUtility reference into the other attached BPCs in the BP
It works but it feels messy
I was just wondering if there was a cleaner way anyone happened to know about
more context usually means better solutions
it sounds like you just threw everything into a component
usually you want to keep components to a certain functionality theme
e.g. health component manages the health of a character
stats component could manage stats of a character
etc.
Hmm, okay
I was just wondering if there were other options in reusing events
But looks like BPC is the way to go
Thanks guys
Kind of related question... In my current project I end up using event dispatchers mostly, in which case components can decide whether they want to bind to each other's events. Is that a normal way of making components talk to each other and the host actor?
... Within a structure of one host actor with many components, I mean
Hello, can someone take a look at this please?
hi
when i spawn my ai using the spawn actor node, it spawns the ai with 0 health
however, if i manually place the bp of the ai into the world, the health is 100
i dont understand whats conflicting with it
it isnt working yet but this make you die inside a little less now ๐
@dawn gazelle
Absolutely XD
I just move the pain somewhere else
I feel like im still doing a stupid elsewhere tho
This is the constructor for the base weapon class
I just could not wrap my head around the other way
but I feel like this is less awful
Now i really dont get why I can cast to this instance of the widget and set values in it for that object
How do I detect when the player is in a pill collider? I want the player to take damage when when not in light and I figured the best way to do that was to create a pill collider in its own bp and tag it, then attach the bp to any lights I use and set it to about the lights throw distance. If this is the hard way of doing this, I would love to hear another way.
this mechanic, specifically from the thief game, would check the lightmap value at the player's feet
You need to do the "Get User Widget Object" before the cast.
(I'm guessing)
The actor moves in a completely different location to it
Will someone be able to quickly voice chat with me?
Get actor location is t relative, it's world
I resolved that
But i've came into another issue. The actor I want to follow in grouped with another one, and it location is relative to that actor
So when that actor is rotated my object moves to the original location and not not follow it because it's location does not change
Hopefully that makes sense
I have a rotation on the star
The gray ball needs to move with it
Using those points attached to the star
Although once it rotates those positions don't update
Hi! I've got a bit of a problem. I'm trying to send the players Pitch, to the server which then sends it to other players, but it's only affecting the other persons rotation in the server view
You need to pass values through RPCs. It can't read the value from another execution path.
RPC's?
Remote Procedure Calls (what you're trying to do)
The events that say "Run On Server" and "Runs on All" or "Runs On Client" are RPCs.
You can put inputs on them to pass values to the server, and from the server to clients.
That's what I do though don't I?
No. Part of the issue is calling "Get Control Rotation" on a controlled character in multiplayer is that the value is actually stored in the player controller of the character, which doesn't exist on other clients. So when you're doing the "Executes On All" it's trying to read a value from the player controller that doesn't exist on the client trying to read it.
Oh I think I understand
You only really need to have an input on the "Executes on All" event and pass the GetControlRotation value to it.
Then you use that value on any clients that need it.
No - server already knows about the client's control rotation, so you don't really need to tell the server the value.
Alright I'll try that thanks!
(So yea, you may still need a "Run On Server" RPC to trigger the process, just that you don't need to pass the value through it!)
I found a better way to phrase my question
I need help with location. World vs relative**
I have an object grouped with a rotating object. I want get the location of the object connected to the rotating object as it rotates
How can i do that
can someone try to answer this? Maybe we could vc so you can get a more in depth look
@obsidian ridge"transform location" and "inverse transform location" converts a relative location to a world location and a world location to a relative location respectively
Like this?
i think the transform has to be from another component, such as the actor itself
Star locations are actors
Is there a way to store the result of the pure function node (green one) without storing it to a variable?
I realised that even though I'm using the same wire from random node, it returns different result when fed into two consecutive print strings.
so get actor transform(self) goes into T and star location 1 goes into location
but if you want to turn relative into world, you use transform location instead of inverse transform location
Okay so I did that, and it still does not follow it's location
It goes off screen
Im not too knowledgeable on this, but i think the only way to store stuff is through variables, otherwise just directly drag off the pure function output
hm
try all the different combinations
im not sure which one is the right one to use
This is what I have
I have other location that are variables, that I had previously
I'm trying to make it work while the actor it follows rotates
ill have to think on this, im really not sure what to do now
@obsidian ridgewhat is this for? there could possibly be an easier way to what you are doing
What does that even mean
I can screen share if you'll like
My guess would be that you may be running into floating point math accuracy issues... You start to lose accuracy with floating point numbers once you're getting too big or to small.
So if you're starting at 1 and diving down by a quarter each time, after 5 divisions you're already at 0.0009765625 which cannot properly be represented by a 32 bit float as they can only accommodate about 7 decimal places (and unreal will actually display 0.000977 if you try to input this number anywhere)
Ok, even still... Problem still exists. 1000 /4 (5 times) 0.9765625 which unreal will only represent as 0.976562.
hm
The way floating point numbers work is that they cannot contain every possible number combination, so you're going to lose accuracy somewhere.
Which can even happen in larger numbers.
Need to move with the star so i can aim and shoot it
@dusk dustThat looks WAY too fast to be floating point problems
It happens after like 2 iterations right?
like it's visibly way off
Print your grid sizes, what results are you getting
i see
okay one sec
I appreciate it I've been on this for such a long time
@obsidian ridgeReal quick, what exactly are you trying to do?
Ive sent a video a few messages up
That doesn't exactly explain it. You want the star to always be in front of the camera and facing it?
The gray circle needs to move with the star when it rotate
I have a few actors working as locations attached too it
Im not sure what im looking at with the photo? The grid looks odd, but way more than accuracy? So i thought it was intended...
Why not just attach the grey circle to it
Although the locations are relative with the star and I cant get the actor to move too it
It moves everything
And it becomes offset
Scratch that it does not move everything, but it does not move to the set locations, it is very offset
Attach the circle to the star and use set relative location or add local offset to move it
?
im setting up the print
i messed up something so im trying to fix it before printing the values @faint pasture
okay well ive ruined it, its now doing something else
anyway ill print the values
cant make sense of this but here
0 subdivisions
1
2
3
4
at least it looks like it's being more accurate, just not in the right spot now ๐
shouldnt it be from there?
okay okay
so
it turns out
for some reason I was subtracting the nodes position by the actors position, which caused it to flip direction when subdividing
interesting
well good find i suppose
yes
i tend to stay all positive when doing things like this
though i wonder if the other problems disappear with this
to avoid things like that ๐
lol
so actor root is at the corner, and not center
Okay I got it working with every location set at 0,0,0. Although If i move the main object in the group it messes up
Once I move it the previous location stays and does not follow it's new location
Although I'll figure that out tomorrow
@dusk dust Why are you doing this weird operation and not the classic quadtree?
What's the use case?
Got some trouble with this code. I've been trying to rotate the forward vector (only the vector as it is required for the rest of the code) of my character towards an AI character, but no success so far. Any idea of what could be done?
Is there any benefit of using Blueprint interfaces over Parent Inheritance?
is there a reason for you getting the location of your skeletal mesh instead of "GetActorLocation" ?
Flexibility across classes that dont nicely blend in a hieriarchy
Would you suggest to rather use that If I'm not sure if I will need it or not?
I thought I needed the world location in order to make the rotation work properly.
Actor location is world location :o
I tend to not use it but my setup is probably weird in more places than one ๐ i often rely on inheritance
It'd be interesting to see an in depth "proper" setup using probably what ends as a combination of the two
Composition beats inheritance every time. Also locking yourself into a parenting hierarchy everywhere does seem weird ๐
Fight me! ๐
I mean it's a generalization of course given the environment is 100% inheritance
Tried searching, but could you explain a bit what "target-start" is?
target location - actor location
So i've been told, yet i keep coming back to inheritance ๐ And keep ditching the interfaces
There are other ways than interfaces
Class members, components, subsystems
There are various ways to structure your functionality more modulary and not 100% relying on inheritance
It's about picking the right tool for the right job, how it makes the most sense to structure your work
I feel fairly flexible in my setup. Then again my master class mostly is just an interface
Im probably just using actual interfaces wrong tho
like trying to use them as i would use inheritance or smth
Managed to figure it out. Using get unit direction now gives the vector I needed from the character to the AI character.
My chaosvehicle is setup. and works. but it moves backwards. and i can't seem to find what causes this. anyone know what could be the problem?
fair point.
Is there a way to 'clip' a widget's bounds?
For example, I have an Image which is 512x512 in size. But I want it to be treated only as 200x200 in a grid panel.
Is this possible?
@sharp rapids Actual clip, or shrinking? Because if you set the brush itself to 200x200, it'll shrink the image.
Hello. I have a mesh component (child of another mesh). I want to enable physic sometime for falling, after that i have an option to put it back to it's place for this i use AttachComponentToComponent. After that if nothing holds it (a bool component give the information) should fall again. The problem is here, that after the Timeline finished in Falling custom event, the mesh will stop in air, he dont care about simulating the Physics (at first fall it works). I thought there is a problem with attaching, so before simulating i used DetachFromComponent node, but changed nothing.
Here is my Falling event:
and the reattachment.
(before reattachment i disable physics)
oh , before i disabled the collision to test something and i forget to enable collision back before attachment. Nvm, it works.
Actual Clip
I want to show the whole image, just only clip the bounds. Right now, the image occupies 512x512 space in a grid panel. I want it to occupy a lesser size (for e.g. 200x200), but not shrink the image in the process.
I've managed to get it working using the Transform of the Image
Put it in a grid panel, reduced it's size, it shrunk the image then I scaled it back up using the Scale property in the Transform section
Hmm. For something dynamic on that you'd probable need something like a canvas wrapped in a sizebox.
Anchor the image to 0.5 on alignment and anchors in the canvas, and then set the sizebox wrapping the canvas to your 200x200
Yep, that works and is a better solution that what I've been doing
Thank you ๐
Green is the actual image, dotted is the Size box
correct way to return all 3 value arrays appended?
Append?
like make one array that contains all 3 arrays
hello, how can we get the spline length between two spline points
GetDistanceAlongSplineatSplinePoint BP function starts from point zero till some index
If that's the only function at your disposal, you could measure the distance from point zero to each of the two indices, then subtract the lower distance from the higher to get the distance between those two points
thanks
When I'm applying Physics Constraint component to the actor blueprint, the constraint refuses to move with the actor, so static mesh stays in one place. what causes this?
If anyone has used the remote control web interface before
- Is it possible to set the value shown in the web interface from the app? Or is it 1 way only (Web controls app only)
I'm trying to set the exposed property based on actions in the app but it's not reflecting in the web interface
It does it in 4.27 as well fully rebuilt the code. it makes no sense
It even switched gear in "reverse" so the car is backwards.
Using Steam Advanced Sessions plugin - Specifically Advanced Voice.
What is the difference between a Remote talker and a Local talker?
Hi.. i wonder is there a easy way to get a pawn speed ? i tried to get velocity and get vector length from that but it doesnt work only when i add force to the mesh
How would I go about spawning multiple mesh instances if for example I wanted to generate a 4000x4000 map of squares please?
This is as far as i got.
I cant seem to find a way to do while X < Rows then spawn an instance of the static mesh
If it consists of only one mesh see https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Components/InstancedStaticMesh/
Else just spawn a new mesh at X * Spacing, Y * Spacing
how can i use a end of a animnoti state to be the condition to change to other animation in AnimBp
When i drag off the Static Mesh I cant find a Create Instance, or Create a Instance Static Mesh theres no options for that.
It's a component
Ahh i have it as a Variable in the blueprint and not a component.
should i use it as a Component and not just a Variable?
Was thinking as a variable I could change the floor mesh and then generate a different floor.
InstancedStaticMesh is a component
You can still use a mesh variable to set the mesh
So the variable sends the mesh to the instanced mesh component and then use the Instanced Mesh Component to create X number of meshes right?
Yes
Thank you
You ofc need to 'send' the mesh variable to the component by yourself
You'll still need a loop tho
@mild crystal get time remaining in current animation and if it's less the .1 switch
Question: If "b" is an instance actor of my actor "A"... why does b has smaller disk size than A when using asset audit?
While loop to create a tower of floors 20px apart? I think this looks right.
I thought it should be larger
@rancid cloud I,m no pro but I guess its because Instance B is reusing the assets from instance A instead of duplicating them it points to them in memory.
I could be wrong though ๐
wahoo I did learn something in about 8mths xD
20uu yeah. Do you know the existence of for-loops?
Yes
Thanks guys. I thought it was weird earlier ๐
I used these in PHP and C# a bit.
Bp has that aswell
Ahh i,ll see if i can find it ๐
Sometimes its hard to translate things into BP form
I assume its this
Sorry... just realized... It's not an instance but a child blueprint. Would this be the same case?
Yes
@rancid cloud I think a child blueprint is "inherited" from it,s parents so likewise I would imagine the compiler takes what it can from the parent before creating new footprints in memory for child.
Disk size yeah, memory size I'm not so sure
Yeah
I like to take guesses at these types of questions as someone will tell me if im wrong ๐
Could you elaborate this one? ๐
The UE documentation is horrible for beginners to understand lol
The child class is inherited from the parent, so logic/data inside the parent is referenced by the child. The size of the child on disk is just gonna be whatever you added to the child above what exists on the parent
This look better?
Ok seems my GPU doesnt like that I used the Starter Content floor 400x400 and it pegs my GPU at 100% when i move the camera lol
I have a GTX 1070 ti
not sure why if its adding "instances" of X mesh and not creating actual meshes as such.
that should only increase performance
the component is made for exactly that
try clearing all instanecs before you start generating if you calling it in-editor
ok ty will try it
Thank you ๐
Why are you launching rather then using some sorta Vinterp or physics constraint to pull the character to the destination?
launching gives you additional problems like drag etc. that you would normally not have when using a grappling hook
yes
any particular reason this is happening every time I open up unreal?
(Using the sun position plugin from epic)
no
that's the thing
super weird
if I refresh the nodes it'll come back to life
but it's happening every time I restart the editor
do you save after refreshing?
yes
idk, try reconnecting the stuff
this is annoying af, ugh
Okay Guys, anyone know Why , this happens?
My Index 1 is Correctly in Array, but When it try to get Index 1 , its look like all empty?
But on Debugging u can clearly See it should work
@swift pewter looks like they're jumping b4 the interp to avoid colliding with the ground
what I need to add to make door open with e?
compared to this
i tried to copy paste it but got errors
also the doors in second image are kinda buggy
I'm getting something weird using widget, when I click on a button my player is supposed to teleport to a location on the map, it's working in standalone but when using it online with the correct RPC the buttons are absolutly useless
The prints works just fine when I fire the teleport but the player doesn't move
Im looking for some one who can teach me blueprint. \
The same blueprint that is supposed to teleport the player work perfectly using a box trigger, am I doing something wrong ?
Any Know how to fix >> "Attempting to move a fully simulated skeletal mesh ItemMesh. Please use the Teleport flag"
Sounds like checking teleport as it suggests would be a way
I'm sorry, but I'm not sure what you're talking about.
You should start with some basic tutorials. There are a few on youtube. They'll teach you bad habits in a lot of cases, but you need to learn to navigate the engine before you can begin understanding it. If you want an actual tutor, be prepared to pay for it and post an add using #instructions. If you have specific small questions, feel free to ask them here.
Bad habbits for sure. But in time, one can learn from it ๐
Enough reference material gets you forward!
i understood it check box in BP node but i don't have idea in editor
Personally started watching this series. little dated, but it was nice considering how little I knew. Helped me piece a lot of things together. https://www.youtube.com/watch?v=FZK5T-vAVFA
thanks
Think i've visited that one a few times
Most of the starting tuts i did was rpg focused ^^
"Advanced inventory" stuff etc
Before it spiralled into everything else
Chances are you are either not referencing something correctly from the button's click or you are doing something slightly different that breaks it.
Ugh. Inventory.
<@&213101288538374145>
Damn, got a macro for that? ๐
Nah. Just quick. ๐
Yeah inventory was troublesome
Add a crafting menu, drag and drop ui and equipment system and we're good to go
For a newbie the entire thing was quite a handfull
is it possible to create a function to trigger a timeline animation? in bp?
Especially with the recursive functions
Yes
This channel is dedicated to exploring Unreal Engine 4 and the Blueprint programming language that it uses. You can think of it as a companion to the API documentation as I try to cover the how and why for what things are used for when using the Blueprint system.
The master project for these tutorials can be found at https://github.com/MWadste...
@jolly inlet
He has playlist of intro to ue4, and other amazing content. Check him out, he's a bit of a legend.
Anybody know of a way to keep an actor exactly on the mouse cursor faster than a linetrace on tick? I'm running into the problem where, if the player turns too fast, the linetrace can't keep up and it lags behind meaning the actor is not on the cursor for a short time. If anyone wants to see how I've got it setup currently: https://blueprintue.com/blueprint/f-u_bfmh/ is for the linetrace and then setting its position:
Actually this is not on tick atm, but on a delay that should, in theory, be faster than tick
Delay faster than tick?
if you look up someone had this problem yesterday
Have you made a delay that can substep?
I think the solution was to create an empty actor at the point of the mouse cursor that your actor can move towards
well, I didn't think it was faster. But I assumed that a tick at 120fps would be 0.00833~ so a delay of 0.001 would be faster
wasn't the case
any delay that is less than delta time will happen on the next tick
I see
I'll take a look, thanks
Widgets only exists locally, meaning replication does not work for them
and bind to a webremote controller?
What are some reason a text widget is now showing up
Atm I just have a plain text over an actor but it wont show
Hidden in game is false
show in game is true
or visible in game
Plain text? Or widget component .
Whats the problem?
it wont show
Not showing up when added to viewport?
Is there anyway to change how editor events show up? Like change the category or give it a tooltip?
events have categories the same way all other variables do
It was working before and it was neven being added to viewport
now im confused
Hmm. Not sure where you change it though
that's strange. I know I've done this before
how can i have two things happening in event begin to play
Use Sequence node
Yeah I'm in 4.27.2 and I can't find anything online about it. If it doesn't exist it really seems like there shouldn't be a technical reason they couldn't add it
It cant be a function, can it ?
Functions can probably not be callable from editor directly.. pretty sure i've seen this aswell tho
I'm at work now so I can't check
yeah you can't do that
you can however do it for functions and call them in editor
(you can right-click on an CE and convert it)
Oh alrighty awesome. Sounds great thank you!
I am making a Blueprint actor for a trigger box to put in front of buildings I want to enter. On begin play, I use the trigger box to find an overlapping actor of BP Building class and set it as a variable so I can call it later. The problem is, Overlap actor doesn't get the blueprint actor. I don't understand what I'm doing wrong. I set the trigger box to enable overlap events as well as BP Building Base to enable overlap events. Does anyone have any idea?
Wouldnt it be easier to add some sockets or whatever to the building doors
Andnin the building beginplay spawn triggervolumes at the socket locations?
Providing self as a reference, if needed
Or just binding up to the callback directly (the event overlap)
I'm doing this in paper 2d. I suppose I could just put this all in the parent blueprint for the building
idk if that is the issue but when Should I be adding a widget to view port for an actor, the idea is when An AI drops a weapon and you stand over it the name show up in a widget set maybe on construction of the actor
oof
replied to the wrong thing
I had it working
then I added a parent class and now nothing is showing up at all
Chances are if you just added a parent class and broke it, you did something like move logic to the parent class, kept the event in blueprint, and didn't call the super.
Example, Beginplay in blueprint doesn't call Beginplay on parents unless the child doesn't use it. If the child uses it, it'll override it and you have to directly add a call to the parent's Beginplay. Most blueprint events are like this.
In the parent?
yes
parent
child
Ive been on displaying name of item player is standing on for 4 straight days now ๐ญ
Hey Guys I am having trouble with referencing a variable,
When the player grabs a gun i trigger an event in the gun that gives over an variable that is used on recoil handling. The OnGripGun gets only called at that point once and the variable only gets set at that point too, and the variable can only be used after the OnGripGun event. When i print things out everything seems properly even the set variable in the gun always prints the right name.
However this variable in the gun fires accessed none errors in play mode, the really weird thing recoil gets applied on the first gun i pick up even with the errors, but on the second it doesnt work at all. I already set the variable to instance editable on & off, no ideas what else i could do to make sure the gun has the right variable reference since it is still printing out the right name. :/
guys, i have a huge problem atm
i've made a custom Scene Component class called SC_GridSystemBase, this has a few child components, a Box Collision (GridBoundBox) is currently the main issue
it's stuck at 0,0,0 and won't follow the transform of the root scene component and I cant find/edit it's transform
have i setup the attachment incorrectly?
Hello. I have a conveyor with a spline on it. I want a mesh to fall on conveyor (the location of hit its not fixed) after the fall i want the cube to attach to spline, but i dont know how to continue after get the closest location on spline. Hove can i get a distance along spline from a location on spline?
When I added the new parent The space was set to world and not screen
and the object was oriented in a way where i could not see it at all
hi guys everytime im moving my mouse to the right the camera doesnt move the char itself moves do u know any fixes?
Is the player BP set to follow control rotation
Hello everybody.
Can some1 please explain me where do i access the code for this function?
There shouldn't be anything inside it. Its just a call to kick off an event in another BP
how do i find the BP which will execute this?
That is an event dispatcher - there can be many other blueprints that hook into it to run code based on when that event is fired.
You can do a search for Reset Pressed to try and find them
Where did you assign the delegate?
i didnt, its the Handheld template project
thanks, will try
Oh, yeah search
this?
Yeah
Is anyone able to voice chat with me really quick? I have a question about InterpControlPoint movement and location stuff
is there a way to do a global search , or do i need to search BP by BP?
Press the binoculars on the far right of the search bar.
thank you very much
thx but why is it moveing the full char on top down pos?
That looks like you may have turned on all the "Use Controller Rotation" options. You want them off if you don't want the character to rotate with the camera.
just have the pitch and yaw on
I think you just want yaw
Any help with this?
no have a up input too
Again if you only want the camera to move, you need to turn off all the "use control rotation" options.
then nothing working
Is the position i feed not able to be updated once given?
For example if the position is moved from the last variable given?
Like chasing a moving object
Is there a way to have an OnComponentBeginOverlap for a actor BP ignore a specific object on my player character? I have a collision sphere on my character for one purpose and I don't want it triggering other things in the level.
So when you have all 3 options turned off, the camera is not moving at all?
no
this is what it looks like if i just enable camera rotation
only the cam is rotating not the mesh
Your original question: hi guys everytime im moving my mouse to the right the camera doesnt move the char itself moves do u know any fixes?
Isn't the intended behavior then that you want the camera to move, and the character to stay stationary?
no sry for explaining it wrong. I just want a normal third person char movement with the cam
So you want both the camera and the character to rotate?
But the character only rotate on yaw of course.
I just have the left right rotation. It works good. The updown rotation is working too but the problem i have with the pitch rotation is this
Turn off the Use Control Rotation Pitch
now just the yaw rotation works
Which is what you were looking for, yes?
no im trying to use both yaw and pitch
You want your character to rotate on both yaw and pitch?
yeah
Thats what this is.
If you have stuff set up like this:
Camera Boom:
Then your character will rotate only on yaw, but the camera will be able to rotate up and down, and the character will follow the camera yaw.
If you enable Use Controller Rotation Pitch, then the character will dip down like you have in your image.
oh okay well i think i have to watch more character tuts
but thank you very much for ur help
Are you trying to get the character to look up or something?
How do I get a different item out of an array each time a button is pressed without changing the array index
(non repeat)
Try to use a random int in range
the next time i run it it will not repeat any previous returns?
you need random item or just not different to before?
The way I did it before was to get a random item from array, then just remove that item. But when I did that. It changed the array index.
both
random and not from before
As in, you can only grab an item once in the entire array's lifetime?
Ok, that's a more complex topic. These basic nodes only feed information into the rotation of the character. What you're wanting to do would need to take that control rotation and apply rotation in the animation graph to make the mesh look up and down. An example of how to do it can be seen in ALSV4 but that's a pretty complicated example and it's not exactly easy to grasp as there's lots to get lost on.
yeah only want to grab once, until i reset it (only use each item once and randomly)
you might want to make a second array that you can draw and remove values out of
Put a boolean on the item, bWasGrabbedFromArray - when you copy the reference to the item, flip that boolean. Check that boolean each time you get a random index from the array.
No other way around it.
I was going to suggest the 2nd array idea first, but figured this was another one of those cases where you were strangely restricted to a single array.
I don't need to be restricted to one array if there's a way to make a new array
as long as 1 on array 1 is still 1 on array 2
It won't be.
No guarantee
If you grab index 3 for your first grab, that's going to be index 0 on the second
make an array like [1,2,3,4] if the array you don't want to change has 4 things. like make an array of indexes. then choose one randomly and remove it from the pool
Instead, there is a method to ignore an actor from being hitted from an instance of an actor?
This would work, assuming you don't change the arrays after the fact.
its an array of actors though
Like, i need my projectile to ignore the player that shoot, but for all other actor need to hit
actors = [actor1, actor2, actor3, actor4], choices = [1,2,3,4]
Set up new collision layers.
And if the player actor is the same to the enemy actor?
so the location of 4 in choices will move, but it doesn't matter
then when you reset, remake the choices array
You'd be creating a whole new collision layer. Why would you put them as the same
And if you don't want to deal with collision layer shenanigans, just check if what you are overlapping or colliding with is the player, if it is, just ignore it.
ok thx
How would I make that work if the game won't know what's in the array before it runs?
with 'out actors', measure the length, then create the array for choices
ah length! XD ty
you're close i can feel it ๐
Same difference. Japherwocky and I are recommending the same thing.
oh sweet! didnt realize you did the whole thing out! Thanks again! ๐
Has anyone ever made a blueprint to simulate tire wear for the chaos wheels? It doesn't need to be anything fancy. Simply losing friction over time would work well.
That would be a physics material thing
Struggling with getting the inventory system working
First screenshot is with an empty inventory
Second screenshot is when I pick up 3 Health Potions
(Technically the first screenshot is an older version, but same behavior)
Well, you icon seems to be working?
Yeah, the icon is working
But not the item name, not the amount, not the effect text
The UI shows x0 even though it shouldn't
And the debug text shows double the amount that should be in the player's inventory - I pick up 1 potion, it says 2, I pick up 3 potions, it says 6
Am I making a mistake with the tracking of the counter?
Or maybe in the actual picking up of the item?
Not seeing the function updating the widget tho
Based off the List View guide I followed, the Construct event should be doing that
Probably dont need a forloop in the add to inv either but i suppose it does the job ^^
The other Construct event, in the widget that the List spawns
I mainly did that to account for if I wanted to give the player 2+ of something
Wouldnt you just add 2 to the current amount in slot, and update the slot once?
Probably just pass the entire struct to the listview widget aswell
Id slap together an example, but not at pc in a while :-/
Maybe it's because I'm a little tired, but I'm having a little difficulty fully picturing what you're meaning (for some things I'm more of a visual learner), sorry
Nothing to be sorry about, im not doing a good job elaborating properly
My point was more that you've set the item's icon correctly from somewhere. So it's possible that you need to set the name and amount there as well.
This is where the icon gets set, which is where it's supposed to set the name & amount
For context, this is the guide I followed:
https://forums.unrealengine.com/t/listview-getting-started-in-bp/123626
Where is that name pulled from and placed in the struct in the inventory?
This thing here has the correct Item Name?
It's pulling from the inventory array in the character Blueprint
And the character's inventory array starts out with 0 array elements, but apparently that gets counted as an element since even with an empty inventory it shows an entry for an item
Start at the beginning. You're picking up this item. Does it have the correct name?
In the Item struct.
Yeah, it does.
Right here. Put a print right after the SetItemCounter inside of the LoopBody. Print out the element's name using a format text and PrintText node. Format it to say ItemInLoop - {Item}
See if all of your entries, specially the last has the correct name.
so, I have this thing that multiplies the current velocity by something and adds it to the velocity on hit
the thing is can I call back to the function every hit and keep adding speed?
using the same multiplier and everything
Huh..
I'm also confused about why it's saying there's 6 in the inventory when I only picked up 3
Oh
Actually that is the issue. I didn't notice that til now. ๐
You're creating a widget, but never adding it to screen, you're using ListView. You don't actually create Widgets directly to use in a ListView, you create small UObjects and populate them with data and send those to the listview.
The Listview will create it's own widgets to handle, what you pass to it is just a data object for it to use.
The guide shows doing this:
So me doing that is (at least part of) the problem?
Most likely. Your widget you're passing data to isn't actually doing anything with it. Lemme show you how listview is actually supposed to be used. That guide is basically bringing a dump truck full of objects to do what a shovel could fill.
Ah. I figured ListView was the easiest way to dynamically show more of the widgets whenever the player picks up new items
not sure if sticks or ticks
It is. And it's fine to use Listview, but you definitely don't need to create a full huge UserWidget class to pass data do it.
Ah
I think i need some math help here, im currently working on a UI element for my sailing game, but im struggling with finding how to project the wind direction in relation to the ship