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"

'Angry Birds' type shooting mechanic help

So I have a basic shooting mechanic for an angry birds type game but I am having problems with figuring out how to determine the force by how far back the mouse is dragged. Any and all help would be appreciated. Below is a picture of what I have so far.

Thanks in advance! :D

alt text

Product Version: Not Selected
Tags:
help.png (376.2 kB)
more ▼

asked Oct 28 '15 at 07:52 AM in Blueprint Scripting

avatar image

ThatGuyMiniB
38 20 17 21

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

1 answer: sort voted first

Presuming that your just simply trying to convert that vector (initial location - current location) into the force of the shot, just get rid of the normalize node. It's reducing the length of that resulting vector to 1.0f. You want the length of that vector to matter.

Then just continue to do what you're doing (multiple the result by a float to scale it by a sensible amount.

more ▼

answered Oct 28 '15 at 10:24 AM

avatar image

Triblade
374 10 79 33

avatar image ThatGuyMiniB Oct 29 '15 at 12:41 AM

Cool! That works perfectly! Is there a way to set the maximum vector of the mouse pull back so the player cant get crazy amounts of values?

avatar image Triblade Oct 29 '15 at 09:07 AM

You can use the 'ClampVectorSize' for that.

avatar image ThatGuyMiniB Oct 30 '15 at 03:07 AM

The clamp doesnt seem to be working.

alt text

screenshot (4).png (772.9 kB)
avatar image Triblade Oct 30 '15 at 09:25 AM

I doubt it's the clamp that's not working (and I doubled checked here too), something else must be going wrong.

If you print out the results of the clamp, what sort of values to do you get? What are you hoping to see? Have you tried reducing the maximum size?

avatar image ThatGuyMiniB Oct 31 '15 at 12:49 AM

It looks like it prints the y and z values but it still isn't applying the force to it. It's weird though because when i set the min to 0 and the max to 9000000000000 or some crazy number it will apply force.

avatar image Triblade Nov 01 '15 at 02:20 PM

I'm not really sure what to suggest at this point - If it's working without the clamping, but not without, are you sure the size of the vector isn't just really small, or in the wrong direction or something? You could try working out what sort of value gives you the result you want (plug the numbers in yourself, straight into 'Force') and then compare them to the results you're getting and see what's going wrong.

(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