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"

Moving multiples of the same actor in different directions

Hi, I'm making a simple 2d space invaders-esque game for an assignment I'm working on. I have a 'Boss Ship' which deploys a bomb, after a time, the bomb stops and explodes sending up to 12 shrapnel actors in different (equal angles) directions

My problem is, I'm unsure how to affect the movement of one shrapnel actor without it having the same effect on all the other spawned actors. I tried using Instanced Static Meshes until I discovered that these can not be moved after run time. I had the logic working, but the Update Instance Transform would not work.

Any help would be appreciated, thanks!

Product Version: UE 4.15
Tags:
more ▼

asked Mar 17 '17 at 02:54 AM in Blueprint Scripting

avatar image

Plitz
3 2

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You could use projectiles to that.

Create a new Blueprint class called BP_BombShrapnel:

  • Add a Projectile Movement component

  • Add a Sphere Collision, and make it the root.

  • Add a static mesh, set it to be the mesh of your shrapnel. Make sure it is pointing forward on the X-Axis.

  • Set your projectile movement component with these settings, or whatever you need:

alt text

You may also want to set Projectile Gravity Scale to 0.

Then in your Bomb blueprint class, do the following:

alt text

Since you are in 2D, you might need to adjust what axis that is rotating on, but the idea will be the same.

At the moment your projectiles won't collide with anything, but if you set the collision sphere to BlockAll, they will collide with eachother since they are spawned in the same location. So one way to fix that would be to add a new collision channel in your project. In project settigns, go to collision, and add a new Object Channel, call it Projectile. Then go back to your BP_BombShrapnel, click the sphere collision and set it like this:

alt text

How it looks: http://imgur.com/a/spv6m You could reduce the velocity and speeds to get a slower shrapnel too obviosuly

bp_bombshrapnel.png (383.1 kB)
bp_bomb.png (102.8 kB)
collision.png (22.9 kB)
more ▼

answered Mar 17 '17 at 03:51 AM

avatar image

Mosel3y
1.8k 48 20 67

(comments are locked)
10|2000 characters needed characters left
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