Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Hold Item In Front Of FPS Camera?

ygm7
Registered User
Quote
2017-11-07 17:32:00

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!


niko
Moderator
Quote
2017-11-10 07:44:18

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.


ygm7
Registered User
Quote
2017-11-10 14:32:23

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!


niko
Moderator
Quote
2017-11-11 04:45:58

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.


Zoo
Guest
Quote
2017-11-11 21:01:38

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


niko
Moderator
Quote
2017-11-12 06:46:26

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.


ygm7
Registered User
Quote
2017-11-12 16:23:14

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.


ygm7
Registered User
Quote
2017-11-12 21:29:11

*Disappeared (not Dispersal)


niko
Moderator
Quote
2017-11-13 19:15:54

I think that one only works for objects not managed by the physics engine. Did you have a physics behavior attached to it?


ygm7
Registered User
Quote
2017-11-13 19:35:43

No, I did not have any physics behavior, but now, oddly, nothing is happening when I click...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact