x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Making a variable accesible to other blueprints

Hello Unreal Community this is my very first post.

My question is: I am planning to make a side scroller 3d shoot em up game. I want to be able to limit my spacefighter Up/Down movement relative to my fixed cams frustum at the spacefighters distance. and required mathematical formulas for computing frustum height min/max is as follows tan(verticalFOV/2)*distance verticalFov=2*atan(tan(horizantalFov/2)*height/width) i created camera and placed it to scene center and converted it to a camera component blueprint and computed my frustum height the problem here is i want my Pawn movement to be clamped between frustum height. but i am not able to transfer the frustum height information that i was computed from camera component blueprint to my spacefighters blueprint.

any help would be appreciated.

Product Version: UE 4.15
Tags:
more ▼

asked Aug 21 '17 at 10:04 AM in Blueprint Scripting

avatar image

ekarasakal
3 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Store your refference or just the result somewhere easy to access like GameMode/GameInstance or even your Controller.

BeginPlay -> getGameInstance -> CastTo YourGameInstance -> Set VariableNameYouChoose and pass self (YourBP or Component that has the Variable you want to get) or just the Result after you calculated it.

Inside your Fighter you get the Variable from there when you need it. No need for get all Actors of Class and it will work with dynamicly spawned Fighters out of the Box.

BeginPlay -> getGameInstance -> CastTo YourGameInstance -> Get VariableNameYouChoose

more ▼

answered Aug 21 '17 at 11:39 AM

avatar image

Nachtmahr
7k 143 28 172

avatar image Nachtmahr Aug 21 '17 at 11:45 AM

Additional recomanded Training Video:

https://www.youtube.com/watch?v=EM_HYqQdToE

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

You could Get all actors from class space fighter (or whatever name it has) on begin play inside the camera component blueprint and then cast the variable you want the space fighter to receive, to the space fighter with the "cast to" node on event tick. I don't know how cost efficient this is, but I think it should to the job.

more ▼

answered Aug 21 '17 at 10:35 AM

avatar image

Aphermion
321 4 6 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question