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"

Why is the collision box for my static mesh offset from the actual mesh?

I have a big hollow static mesh box I am trying to use as the collision bounds for my camera/character. In the mesh editor I have set the collision and the green box neatly outlines the mesh.

When I get into the game however, the actual collision takes place in a way that makes it seem as if the bottom right corner of the collision box is in the middle of my hollow mesh.

I have used all the collision types including sphere, and even the sphere is offset.

It doesn't matter if I spawn the mesh in my level or physically drop it in.

Product Version: Not Selected
Tags:
more ▼

asked May 23 '14 at 01:35 PM in Blueprint Scripting

avatar image

Zeustiak
1.8k 131 68 110

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

1 answer: sort voted first

If you are trying to create a collision for the set of objects, your mesh and your camera, the best way to do this is in the Blueprint for the set of objects. You should only be handling collisions for a static mesh in the mesh editor (as far as I have seen).

Check this out... I have the sample character from one of the examples and they use a Capsule Shape component as the general collision for the player. You could do the same but use your cube or whatever shape and simply move/rotate it to fit your needs. The player skeletal mesh also has collision handling, but this is separate.

Example Character General Collision Setup

more ▼

answered May 23 '14 at 02:16 PM

avatar image

AnxGotta
1.6k 61 45 237

avatar image Zeustiak May 23 '14 at 02:25 PM

The collision box is supposed to be a kind of arena for the player camera. It is supposed to be an invisible wall that keeps the player in the middle. IE above the hex map.

Maybe there is some ridiculous separation between my camera and my player pawn. I will have to take a look at that in the morning.

avatar image AnxGotta May 23 '14 at 02:38 PM

Hmmm. I'm not really sure what you mean here. If you mean what I think, and that you are trying to keep your player/camera inside some boundary. Is this for the whole map? Is the boundary dynamic with the character movement?

avatar image Zeustiak May 24 '14 at 01:20 AM

I have a map that generates say 1725x by 1000y. This is a turn based strategy world map, like in civilization.

The boundary box is supposed to keep the player pawn, which floats above the map and can move around, from moving off into the void beyond the map.

For some reason, the collision on this box seems to be offset from the actual rendered box.

avatar image Zeustiak May 24 '14 at 02:24 AM

Ok, so my camera was something like a thousand units from my capsule.... I must have been drunk when I worked that out however many weeks ago.... :p

Your picture that showed the camera and the capsule next to each other is what gave me the idea that their separation might be the problem, thanks!

Now my hollow collision box is kicking my player out of the box(and then can't get back in), but that is a separate issue so I will create a different question for that if needed.

avatar image Zeustiak May 24 '14 at 03:00 AM

If anyone sees this, you need to use complex collision on a hollow box to get collision to work. With simple collision it wants to kick you out of it's bounds.

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

I thought about this for a bit, and came up with what I feel is a reasonable explanation. Short answer is that you might want to start centering your meshes on the origin instead of standing them on the XY plane. Long answer and reasons why are in my answer to my own question.

https://answers.unrealengine.com/questions/58425/root-capsulecomponent-sits-below-origin.html#answer-58446

more ▼

answered Jun 19 '14 at 01:41 AM

avatar image

User-658380556
184 22 36 158

avatar image Zeustiak Jun 19 '14 at 08:54 AM

As I explained in my comments to the accepted answer above, my camera was not in the same location as my player pawn. Thanks.

(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