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"

Swaying light

Hello!

I have the basic lamp from the starter set and I wanted to make the light source sway around a little bit by just having the object rotate on the x axis. In my flow I have tried to outline what I'm logically trying to do. So when the player approaches the area I call the function SWAY, which then looks to see if ticker is true (player is on the box collider) then it checks if Upswing or DNswing is true. For ease I thought I would set UPswing to true and DNswing to false, so that the object always starts swinging towards the positive side of the x axis. I then want this object to swing WHILE under 10 degrees, once it hits 10 degrees, than I want DNswing to be true and it will go until -10 degrees.

I can get the object to move, but I haven't been able to do it smoothly, it will go 10 degrees positive and then restart back at 0, or completely crash. I think I must have something wrong with my logic with While Loops (As I tend to always have issues with them). If I was coding I might do a FOR Loop, i=0; i<11, i++ something like that, but I'm not sure how to do that in blueprints.

If anyone has suggestions it would be appreciated!

alt text

Product Version: UE 4.14
Tags:
capture.png (447.8 kB)
more ▼

asked Jun 14 '17 at 03:19 PM in Blueprint Scripting

avatar image

Kengi9
9 1 1 3

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

2 answers: sort voted first

Hey Kengi9,

To begin with, there are a few issue with your blueprint, but instead of debugging those, I would strongly recommend a Timeline in this situation. It would take care of a lot of your logic without the complexity of your current blueprint. If you aren't familiar with them, there's a great tutorial on using a timeline for a door that you can adapt to fit this situation.

Give this a look:

https://wiki.unrealengine.com/Blueprint_Automated_Door_Tutorial

~K

more ▼

answered Jun 14 '17 at 03:39 PM

avatar image

Kvothe218
71 5 6 10

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

That worked, PLUS I learned about timelines! Cheers!! Thank you so much!

more ▼

answered Jun 15 '17 at 05:38 PM

avatar image

Kengi9
9 1 1 3

(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