Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I want to make my FPS character be able to "hold" items so they kinda hover in front of the camera kinda like in 'Gone Home'. So like you can pick up items from a table by pressing E, then they'll be "holding" the item, then can press E again to drop it. Any Ideas? Thanks! |
||||
|
There are multiple ways to do that. The simplest would probably to have fake child items on your camera which look like the items you can pick up, and make them visible / invisible on demand. |
||||
|
So like hide the original scene node and show another that is hidden by the camera? That would work for basic interactions, but I want to be able to pick them up, then drop them with the physics engine. Is that possible? Thanks! |
||||
|
There is a drag'n' drop downloadable behavior available, which does something similar, but it doesn't work together with the physics, I think at least. But it could be probably extended to work with it, by calling ccbSetPhysicsVelocity() instead of moving the position manually. |
||||
|
Doesn't work niko, I tried it a few months back and it behaves strangely...The block fly's out of the screen and CC crashed for me... I might have done something wrong...but I also updated physics so that the position created collision...That worked fine, but it made me lose some frames... Something is causing a performance issue there and there is some physics bug I am certain of. I found a couple of other physics bugs aswell...One of the behaviors acted strangely and shot me up into the air when I used it on my camera. It was click to move behavior. No matter what I did, even after switching the physics engine off by unchecking it, when I used that behavior on the camera it would always shoot me into the air |
||||
|
Yes, you need to be very careful with the Velocity parameter in physics, it will cause physics engines to behave strangely. You probably know this from other major commercial games. You always need to be very careful on what values you feed your physics engine. Best is to check if the value you want to set isn't too big. |
||||
|
Okay, so I used the drag and drop action without the physics, just to test it, and when I click on it, the item just dispersal. |
||||
|
*Disappeared (not Dispersal) |
||||
|
I think that one only works for objects not managed by the physics engine. Did you have a physics behavior attached to it? |
||||
|
No, I did not have any physics behavior, but now, oddly, nothing is happening when I click... |
|