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"

Unable to move pawn.

I am trying to move a class that derives from APawn. I am getting the movement component of it in script and setting the velocity of it after adding a bit of force. The values going into Set Velocity are correct, but next frame when I Get Velocity, it is still at zero.

I've tried with Simulate Physics and Start Awake on. The "Mass in KG" is set to Zero, but grayed out so I can't edit it. Ideally I'd like to Add Force or Add Force at Point to my Pawn, but I can't seem to figure out how to do that either.

Does anyone have any ideas?

Thanks!

Product Version: Not Selected
Tags:
more ▼

asked Apr 10 '14 at 11:30 PM in Blueprint Scripting

avatar image

Heisenburger
143 15 20 198

avatar image zeroexception STAFF Apr 11 '14 at 08:25 PM

If you are using APawn, there is no default movement component, unless you have added one. Just want to make sure that is out of the way first. You may consider trying what you're doing on Character first to rule that out.

Secondly, are you trying to add physics velocity or velocity to the movement component? If simulating physics, any movement component stuff is usually ignored, and you are committing to using physics for movement and simulation.

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

1 answer: sort voted first

Picking from these answers.

https://answers.unrealengine.com/questions/18734/mass-in-kg0-and-not-editable.html https://answers.unrealengine.com/questions/13455/blueprint-double-jumping.html https://forums.unrealengine.com/showthread.php?835-Setting-weight-in-default-section-of-blueprint-editor

It says you may not be able to set Mass in KG without having collision over the object. I've used Set Velocity with success but AddForce is slightly more interact. I would suggest looking at the Content Example, Level Blueprint_Input_Examples for applied linear physics in the UFO Blueprint. I don't have an example with AddForce that I can find.

more ▼

answered Apr 11 '14 at 07:18 PM

avatar image

PeterLNewton
2.1k 75 37 111

avatar image Heisenburger Apr 11 '14 at 09:00 PM

The UFO blueprint is similar to what I have working now. Though it suffers from the same issue that my pawn has, which is when the capsule hits a wall the friction causes it to spin. I haven't been able to figure out how to turn off friction on it.

avatar image PeterLNewton Apr 11 '14 at 09:29 PM

Oh okay, so that's the problem you're having. I created a ship in another game and I found a solution that works for me. There may be settings to do such, but this is what I have done and It may possibly work for you. What I do is limit the rotation of the object by flagging the rotation once a certain limit is passed then gradually update its rotation with Rinterp To prevent flipping.

alt text

limitrotation.jpg (121.9 kB)
avatar image Heisenburger Apr 11 '14 at 09:32 PM

It's one of the roadblocks I've run into. I've been trying a bunch of different ways to obtain the desired effect (swimming). Does your network just clamp the absolute world rotation? Or does it limit the max angular rotation to prevent fast spinning?

avatar image PeterLNewton Apr 11 '14 at 09:36 PM

This one just clamps the rotation. The Rinterp To just makes the change look more pleasing rather than immediately clamping it.

avatar image PeterLNewton Apr 14 '14 at 02:51 AM

Hey Heisenburger,

I found a way to avoid clamping and that whole solution. If you go to your Mesh Component and push the arrow down under Physics. The value Angular Damping will help return your mesh back to a balanced state. I'll let you know if I figure anything else about this.

Update: I also realized that by having my input axis tilt the hover car forward or back, allowed it to go back to a balanced state when no input as given. This may be something to look into, depending how you're applying movement to your vehicle.

avatar image Kich Apr 14 '14 at 05:48 AM

I create Player BP from Pawn class and add the static mesh as root component. Mass in KG for mesh equal zero, but if I place this mesh on the scene mass will be greater than zero. And if I apply force to pawn's mesh, it moves good.

  • Collision geometry exist

  • Density of the PhysicalMaterial applied

  • Mass scale greater than 0

Why in Pawn BP static mesh mass = 0?

avatar image PeterLNewton Apr 14 '14 at 06:31 AM

From what I can tell. It needs to be in game for it to calculate the Mass of the object. More likely, its a bug. Even when I check the content examples, their work is the same way. The small rocket in the physics example has no mass within the Blueprint.

(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