May 23, 2012, 12:37:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Retaining collision when adding to inventory  (Read 557 times)
Ron
Sr. Member
****
Posts: 326


View Profile
« on: February 27, 2009, 07:02:41 PM »


Not sure what I am missing here, could swear I have done it before. Its stumped me for the last 24 hours Undecided

When I add a object to the players inventory, I want to also add the collision that comes with that object. In my case, its wheelie bars for a car. Same situation would apply to a character picking up a flag pole or big weapon or a truck adding a big load.

The inventory object always loses its collision - not sure what I am doing wrong. I did all the updatecollision calls and attachobject in the opr files.

Anybody have any ideas?
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #1 on: February 28, 2009, 04:45:27 PM »

Perhaps try AddCollision() in the vehicle script when it gets the inventory item.

If that doesn't work, perhaps add that collision object to the car at all times and disable it when you don't have the bars.

Would using a joint make a difference?
Logged
Ron
Sr. Member
****
Posts: 326


View Profile
« Reply #2 on: February 28, 2009, 09:13:01 PM »

Can you add or modify collision at run-time? I will look into it. I am good at finding something that is easy and taking the most difficult route, then come back later and find I could have done the same thing in a few lines of code  Grin

I do have it working, but a totally different method. I raycasted at the wheelie bar wheels, then cut engine power when the ray has intersection and at the same time adding a downwards force on the front of the car.

I did have it adding a upwards force at the contact point, but if the force was too little, the wheels would pass right through the track and if it was too much it would knock the back tires off the ground.

PS - have tried the below surface viewport on yours yet? Its still working perfectly for my gauges. Next I am going to put in a whole dashboard for the in car view instead of having to carry everything around with the vehicle.
« Last Edit: February 28, 2009, 09:23:01 PM by Ron » Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #3 on: March 01, 2009, 02:07:47 PM »

I do believe you can alter the collisions at run-time. I know for a fact you can get a handle on each and every one and that you can disable them and enable them. The trick, though, is to make sure that it's being used when it's already enabled.

I have not yet tried the viewport camera. I'm still struggling with the player animation setup. It's high on my list of to-dos.
Logged
Ransom
Full Member
***
Posts: 132



View Profile
« Reply #4 on: March 02, 2009, 09:09:49 AM »



 inventory items ( unless its been added recently) do not carry their collision properties.  You'd need to load a new object with the collision for both the car and its bar.
« Last Edit: March 02, 2009, 09:11:29 AM by Ransom » Logged
Ron
Sr. Member
****
Posts: 326


View Profile
« Reply #5 on: March 02, 2009, 04:25:04 PM »

inventory items ( unless its been added recently) do not carry their collision properties.  You'd need to load a new object with the collision for both the car and its bar.

Thanks, I may not yet be crazy...

Looks like I am going to have to stick with raycasting then. There are so many variations with my cars (car body, wheelie bars, wheels, spoiler...) to make a new object would multiply all my content by 2x and blimp my exported files by alot too.
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!