Ok, so,I have everything set up, I am using sparkys ball bounce function. What I do is if I press a for aim then click my mouse button,the ball shoots at the wall then bounces,but here is the problem,it only shoots backwards then bounces,if I move the ball forward -8 then the ball sticks to the wall,so it only shoots backwards at +8 to work. Here is my code.
object 2 is the player the ball is positiond to.The ball is object 20
shootme=0
if object exist(20)=1 then position object 20,object position x(2),object position y(2)+70,object position z(2)
if object exist(20)=1 then point object 20,camera position x(0),camera position y(0)+8,camera position z(0)
endif
here is if I shoot the ball
if shootbullet=1 and uselight=1
holbullet=1
OX# = OBJECT POSITION X(20)
OY# = OBJECT POSITION Y(20)
OZ# = OBJECT POSITION Z(20)
MOVE OBJECT 20,8 rem only will bounce if shoot backwards,sticks to wall and no bounce at all if -8
X# = OBJECT POSITION X(20)
Y# = OBJECT POSITION Y(20)
Z# = OBJECT POSITION Z(20)
BouncingCollision(OX#,OY#,OZ#,X#,Y#,Z#,2.5,20,0)
move object 16,-8
move object 17,-8
endif
and here is the function for the ball bounce,I am guessing it is the fact It is repositiong the ball at a +number
C = SC_SphereSlideGroup(Group,X1#,Y1#,Z1#,X2#,Y2#,Z2#,Radius#,0)
IF C>0
`Now we obtain the position of the intersection using sc_getStaticCollisionX(), and
`then we get the bounce vector of the collision. Then, position the dynamic object at
`the collision position and point it to the position of collison + the bounce vector,
`and we get realistic bouncing! ;)
NewX# = sc_getStaticCollisionX()
NewY# = sc_getStaticCollisionY()
NewZ# = sc_getStaticCollisionZ()
NormX# = sc_getCollisionBounceX()
NormY# = sc_getCollisionBounceY()
NormZ# = sc_getCollisionBounceZ()
POSITION OBJECT Dyn,NewX#,NewY#,NewZ#
POINT OBJECT Dyn,NewX#+NormX#,NewY#+NormY#,NewZ#+NormZ#
ENDIF
ENDFUNCTION
DELETE MEMBLOCK 1
my signature keeps being erased by a mod So this is my new signature.