How to simple spawn actor at coordinates/location?
Hello to everyone,
I'm working on a Arch Viz project and as i'm pretty new to blueprints and I can't figure out how to spawn an actor : I want to spawn the eau_baignoire geometry cache in my bath tub by clicking on my third UI button (first and second are changing bathroom material and it works fine) : I tried with both a transform location and a TargetPoint also : My UI buttons functions setup : Last is a pic of my water imported from alembic and placed manually (to get the exact coordinates):
Thank you so much for your help.
asked Apr 13 '19 at 08:49 PM in Blueprint Scripting
im guessing your pretty new to scripting in general. the issue comes down to getting a reference to the correct actor. your current method is to get all of class which is a poor way to go about it and its very inefficient. it would be much better to have a specific reference to one definitive actor. to that end how are you creating the widget? you could for example have a variable in your widget which will be the reference to the actor, then when you create the widget you set the variable at the same time. of course thats if your creating the widget from the actor you want to target or can get the reference from there.
really though for your case you may not even need to spawn an actor. it looks like your just trying to have the water show up when you press the button right? if thats the case then you could just have the water as part of the bathtub actor and toggle the hidden in game of the water, basically toggling the visibility.
answered Apr 13 '19 at 09:15 PM
Thanks for you help. I have hard time understanding the links between every element. I tried with help of your indications for many hours without success :
-Couldn't set method one : -With method 2 the bathroom ui does not work anymore (not clickable) : When deleting method 2 (keeping only the new nodes in bp_bathroom > the third vutton function) : i get this error when clicking the third buton :
Tried this also in the bathroom blueprint :
I'm sorry for not understanding everything you tried to explain. I don't understand why you propose to place nodes in the character blueprint and not in the third button settings (function "Bathroom Set C"). Here's a recap of my blueprints :
-Bp_bathroom (the static mesh to change materials)
-Eau_Baignoire (the geometry cache water blueprint)
-UI_bathroom (my buttons)
-TargetPoint_eau (the targetpoint i want my water to spawn at)
Again, all i need is making the water (Eau_Baignoire blueprint) spawn at the TargetPoint_eau location.
Thanks again for your help.
answered Apr 14 '19 at 10:15 AM
They are in my UI_bathroom blueprint.
Bathtub and the furniture aside are in the Bp_bathroom blueprint. The water is its own actor (Eau_Baignoire blueprint) but i gonna add it to the Bp_bathroom blueprint. Let's start like that !
Indeed I used a TargetPoint because the water needs to be a bit higher than the bathtub. But i will delete the TargetPoint and move my water in the Bp_bathroom blueprint with the bathtub and the furniture.
answered Apr 14 '19 at 07:46 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here