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"

What should my pawn componenthierarchy be?

So i have a tank that consists of a bottom part, a turret and a collisioncomponent(UBoxComponent). Right now the turret and bottom are attached to the collisioncomponent, which is the root component of the pawn. What i want is: when the bottom is rotated, the collisioncomponent has to be rotated aswell, but the turret does not. When the turret is rotated, only the turret has to be rotated. I can not do that with my structure. Am i doing it wrong? how should i do this? Maybe there is an option to not rotate a component when the root is rotated? idk

EDIT: After looking further into this i realize i need to disable a child from inheriting a parent yaw rotation in a way

SOLUTION:

SetAbsolute(), which takes 3 booleans: 1 for location, rotation and scale SetAbsolute(false, true, false) works for the turret.

Product Version: UE 4.22
Tags:
more ▼

asked Jul 13 '19 at 11:46 AM in C++ Programming

avatar image

YoloSwagmaster68
33 1 2 4

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

1 answer: sort voted first

Hey,

I would suggest different hierarchy:

Root I would suggest different object like default tranform

Than attach tank body to root. And attach collision thing to tank body.

Than attach cannon to root.

This way you can rotate tank body and collision comp without rotating cannon.

Did I understood you correctly?

more ▼

answered Jul 13 '19 at 06:49 PM

avatar image

Przemek2222
426 4 10 14

avatar image GarnerP57 Jul 13 '19 at 07:03 PM

The Pawn Movement component won't have anything to collide with on the root though so it will go through anything.

avatar image Przemek2222 Jul 13 '19 at 07:12 PM

Yea, I didn't tested this. Then cannon should be separate actor and it should be attached.

avatar image Przemek2222 Jul 13 '19 at 07:14 PM

Like this:

alt text

attach.png (35.5 kB)
avatar image YoloSwagmaster68 Jul 14 '19 at 11:04 AM

What exactly is a default transform? (the suggested root)

avatar image Przemek2222 Jul 14 '19 at 01:35 PM

Nvm as GarnerP57 said my first solution will don't work. So you need to make Turret as separate actor and attach it to tank body.

It will work. I have set up ships with 14 cannons as separate actors attached and it works.

avatar image YoloSwagmaster68 Jul 14 '19 at 08:49 PM

I made the turret a separate actor and attached it to the tank mesh. But when i rotate the tank mesh the turret logically also rotates. Is this not what you meant or am i stupid? So basically the turret has to follow the location but not the rotation.

avatar image Przemek2222 Jul 17 '19 at 10:19 PM

Are you sure you didn't set Rotation rule to snap to target? It should be Keep world.

avatar image YoloSwagmaster68 Jul 18 '19 at 11:44 AM

But those rules are just for what happens when you attach it right? i want it to keep the world rotation at all times.

avatar image YoloSwagmaster68 Jul 18 '19 at 03:18 PM

SOLUTION: SetAbsolute(), which takes 3 booleans: 1 for location, rotation and scale SetAbsolute(false, true, false) works for the turret.

(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